Hi All,
I am stuck at a design issue and I seek the help of the Hibernate experts to guide me in this.
I have got 2 entities A & B. A has got one-to-many with B while B has got many-to-one relationship with A. Entity B's crud operations can only be fired when entity A's crud is fired i.e. user cannot directly affect entity B.
I am thinking of using an EmptyInterceptor to do crud operations when there is a crud operation on the entity A. I am doing this to make sure that B's crud operations are not always fired and they occur only when Hibernate does any crud operation on entity A.
Please let me know if this is the right approach. If not what else can I use, keeping in consideration:
- There can be many operations on B (multiple create, update, delete) when user makes a change to A.
- Changes in B should only happen when there is a change in its parent A.
Regards,
Nitin
|