Hibernate version: 3.0.5
I've checked through the reference documentation and looked briefly through the event.* api looking for something suitable but haven't been successful so far.
I'm looking for an ability to capture relationship events between entities (basically adds & removes).
ie)
Project --> Sample
If I add Sample.Y to Project.X, it would be nice to have an event triggered that would give me information from the *..1 side (ie. ADD_REL from Sample.Y to Project.X).
This information is used to construct a JMS message that is sent to a thick client listener. We're re-architecting an existing ejb-based system that solves this problem by inserting explicit message creation code in the cmr relationship setters.
Looking at the api, it's appears trivial to get notifications on a per-entity level (ie. this sample has been added, this entity has been removed). It would be a great help to know where/or what prompted the add/remove.
Is this possible to do using the current hibernate api with a custom event listener/interceptor and/or an AOP piece?
|