Creating,updating or deleting other items in interceptor

[code lang=”java”]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);

}
}[/code]

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

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