Creating,updating or deleting other items in interceptor

public class MyCustomerPrepareInterceptor implements PrepareInterceptor {
private static final Logger LOG = Logger.getLogger(MyCustomerPrepareInterceptor.class);

@Override
public void onPrepare(CustomerModel customerModel, InterceptorContext interceptorContext) throws InterceptorException {
  . . .
  final MyItemModel myItem = 
  interceptorContext.getModelService().create(MyItemModel.class);
  interceptorContext.registerElement(myItem);
  //interceptorContext.registerElementFor(myItem, PersistenceOperation.DELETE);
  . . .
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.