public class IdTransferringMergeEventListener
extends org.hibernate.event.def.DefaultMergeEventListener
NullPointerException that occurs
for entities with composite IDs.
Original documentation:
Extension of Hibernate's DefaultMergeEventListener, transferring the ids of newly saved objects to the corresponding original objects (that are part of the detached object graph passed into themergemethod). 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: theHibernateClinicandTopLinkClinicDAO implementations both use straight merge calls, with the Hibernate SessionFactory configuration specifying anIdTransferringMergeEventListener. Typically specified as entry for LocalSessionFactoryBean's "eventListeners" map, with key "merge".
| Constructor and Description |
|---|
IdTransferringMergeEventListener() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
entityIsTransient(org.hibernate.event.MergeEvent event,
Map copyCache)
Hibernate 3.5.6 implementation of ID transferal.
|
cascadeAfterSave, cascadeBeforeSave, cascadeOnMerge, copyValues, copyValues, entityIsDetached, entityIsPersistent, getAssumedUnsaved, getCascadeAction, getMergeMap, getTransientCopyCache, mergeTransientEntity, onMerge, onMerge, retryMergeTransientEntitiesgetEntityState, getLoggableName, invokeSaveLifecycle, isVersionIncrementDisabled, performSave, performSaveOrReplicate, saveWithGeneratedId, saveWithRequestedId, substituteValuesIfNecessary, validate, visitCollectionsBeforeSaveprotected void entityIsTransient(org.hibernate.event.MergeEvent event,
Map copyCache)
entityIsTransient in class org.hibernate.event.def.DefaultMergeEventListenerCopyright © 2014 Atlassian. All rights reserved.