Hibernate 3.3.0 Snapshot
I have a fairly involved association graph for my entities and I need to hook in to the appropriate event handler to post-process all entities as they are saved.
All my relationships are bi-directional, with the "one" side owning the relationship
For example:
Document
has many LineItems
has many SupplierProducts
has Supplier
has Manufacturer
has many Shipments
has Customer
has Contacts
Which event listener allows me to capture the original Entity (for each of the associations as they are cascaded) with ID assigned and then call my callbacks that I add to those entities?
I have hooked into MergeEntityEventListener, and I get access to the original entity (so I have access to the callbacks assigned to that object), and the newly created identifier for the object, but the problem is the event doesn't get called for *every* entity in the graph. As per the example above, the SupplierProducts and Shipments are not captured in the "merge" event. Maybe it's because they are collections. Which events do I need to hook into to capture the saving of *all* entities in the entire graph, including the collection entities, and such an event where I have access to the original objects (with my callbacks assigned) and the newly created identifier for each entity as been assigned?
Aaron
|