Hi all.
I need to delete elements included in a collection in a parent object. I can do this annotating the collection property (in parent) with
Code:
@org.hibernate.annotations.Cascade(value = org.hibernate.annotations.CascadeType.DELETE_ORPHAN )
but also, I need to raise an action before do effective the deletion. I mean: if I delete an element from a collection (Set), before remove from database I need to defer some entities, print traces, etc.
Is there any way to do this? i'm looking for something like a trigger, handler, interceptor or a similar mechanism...