public class IdTransferringMergeEventListener extends org.hibernate.event.def.DefaultMergeEventListener
Transferring newly assigned ids to the original graph allows for continuing to use the original object graph, despite merged copies being registered with the current Hibernate Session. This is particularly useful for web applications that might want to store an object graph and then render it in a web view, with links that include the id of certain (potentially newly saved) objects.
The merge behavior given by this MergeEventListener is nearly identical
to TopLink's merge behavior. See PetClinic for an example, which relies on
ids being available for newly saved objects: the
TopLinkClinic DAO implementations both use straight merge
calls, with the Hibernate SessionFactory configuration specifying an
Typically specified as entry for LocalSessionFactoryBean's "eventListeners" map, with key "merge".
LocalSessionFactoryBean.setEventListeners(java.util.Map), Serialized Form
DELETED, DETACHED, PERSISTENT, TRANSIENT
|Constructor and Description|
|Modifier and Type||Method and Description|
Hibernate 3.1 implementation of ID transferral.
cascadeAfterSave, cascadeBeforeSave, cascadeOnMerge, copyValues, copyValues, entityIsDetached, entityIsPersistent, getAssumedUnsaved, getCascadeAction, getMergeMap, getTransientCopyCache, mergeTransientEntity, onMerge, onMerge, retryMergeTransientEntities
getEntityState, getLoggableName, invokeSaveLifecycle, isVersionIncrementDisabled, performSave, performSaveOrReplicate, saveWithGeneratedId, saveWithRequestedId, substituteValuesIfNecessary, validate, visitCollectionsBeforeSave