This content has been marked as final. Show 2 replies
The entity (descriptor) events will all be on a per instance basis. To accomplish what you want I would recommend using a SessionEventListener (see the extensions doc for config details).
SessionEventListener.postCommintUnitOfWork or postCalculateUnitOfWorkChangeSet
Within these events you can access the UnitOfWork (TopLink's transaction abstraction within the EntityManager) change-set or delta. This change-set will let you see all objects created, modified, or deleted within the transaction.
The UnitOfWork contained within the event will have a UnitOfWorkChangeSet that you can interrogate for your purposes.
Can you provide a link to the "extensions doc" you refer to here?
I'm trying to use SessionEventListener.postCalculateUnitOfWorkChangeSet and it doesn't appear to be giving me any references to new entities created within the unit of work. I can see them in my debugger (under newObjectChangeSets), but my call to getAllChangeSets() doesn't include these.