Hi,
I'd like to obtain information about which entities (instances) were created / updated / deleted during a given session, up until the moment of flushing.
Rationale: before flush, I'd like to execute some additional business logic (amongst wich validation) on these entities.
Currently, I wrote an interceptor that maintains a created / updated / deleted collection by itself. It adds the objects that it receives from the onSave, onDelete etc. callbacks. Before flush, I inquire the interceptor for its collections, and I execute the required methods on the collection's objects. Rationale: allow for "coarse grained" validation and correction before flush.
However, by maintaining these collections, I feel that I am duplicating information from the Hibernate internal administration.
I was wondering whether there is another way of yielding this information from the session ? I looked at the statistics interfaces in org.hibernate.stat, but these do not seem to give me the information I need.
Many thanks,
- Fernand.
|