I don't think the @PreRemove annotation will do what you're looking to do. I assume you want your application to be able to blindly remove an Entity and have the logic in your @PreRemove method decide whether or not the remove should happen?
I don't see any mention of stopping a remove operation when in a @PreRemove method in the JPA spec... but I may be missing something? -Rick C N Davies wrote: > > Is there any method in OpenJPA to block entity deletion, I can't find any > way to do it? > > > > What I want to do is create a @PreRemove method that checks some criteria > and either allows the remove process to continue or alternatively reverts > to > an update method. When I tried to code an update in the @PreRemove method > OpenJPA throws an exception. I can do this in a DAO or a service class > but > being able to do this within the @PreRemove method looks a little cleaner > to > me. > > > > Thanks J > > > > Chris > > > > > -- View this message in context: http://n2.nabble.com/Intercepting-blocking-delete-tp3209946p3213914.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
