public class DefaultSaveOrUpdateEventListener extends AbstractSaveEventListener implements SaveOrUpdateEventListener
AbstractSaveEventListener.EntityState
Constructor and Description |
---|
DefaultSaveOrUpdateEventListener() |
Modifier and Type | Method and Description |
---|---|
protected void |
entityIsDetached(SaveOrUpdateEvent event)
The given save-update event named a detached entity.
|
protected Serializable |
entityIsPersistent(SaveOrUpdateEvent event) |
protected Serializable |
entityIsTransient(SaveOrUpdateEvent event)
The given save-update event named a transient entity.
|
protected CascadingAction |
getCascadeAction() |
protected Serializable |
getUpdateId(Object entity,
EntityPersister persister,
Serializable requestedId,
SessionImplementor session)
Determine the id to use for updating.
|
protected boolean |
invokeUpdateLifecycle(Object entity,
EntityPersister persister,
EventSource source) |
void |
onSaveOrUpdate(SaveOrUpdateEvent event)
Handle the given update event.
|
protected Serializable |
performSaveOrUpdate(SaveOrUpdateEvent event) |
protected void |
performUpdate(SaveOrUpdateEvent event,
Object entity,
EntityPersister persister) |
protected boolean |
reassociateIfUninitializedProxy(Object object,
SessionImplementor source) |
protected Serializable |
saveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
Save the transient instance, assigning the right identifier
|
cascadeAfterSave, cascadeBeforeSave, getAssumedUnsaved, getEntityState, getLoggableName, getMergeMap, invokeSaveLifecycle, isVersionIncrementDisabled, performSave, performSaveOrReplicate, saveWithGeneratedId, saveWithRequestedId, substituteValuesIfNecessary, visitCollectionsBeforeSave
reassociate
public void onSaveOrUpdate(SaveOrUpdateEvent event)
onSaveOrUpdate
in interface SaveOrUpdateEventListener
event
- The update event to be handled.protected boolean reassociateIfUninitializedProxy(Object object, SessionImplementor source)
protected Serializable performSaveOrUpdate(SaveOrUpdateEvent event)
protected Serializable entityIsPersistent(SaveOrUpdateEvent event) throws HibernateException
HibernateException
protected Serializable entityIsTransient(SaveOrUpdateEvent event)
event
- The save event to be handled.protected Serializable saveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
event
- The initiating event.protected void entityIsDetached(SaveOrUpdateEvent event)
event
- The update event to be handled.protected Serializable getUpdateId(Object entity, EntityPersister persister, Serializable requestedId, SessionImplementor session)
entity
- The entity.persister
- The entity persisterrequestedId
- The requested identifiersession
- The sessionTransientObjectException
- If the entity is considered transient.protected void performUpdate(SaveOrUpdateEvent event, Object entity, EntityPersister persister) throws HibernateException
HibernateException
protected boolean invokeUpdateLifecycle(Object entity, EntityPersister persister, EventSource source)
protected CascadingAction getCascadeAction()
getCascadeAction
in class AbstractSaveEventListener
Copyright © 2001-2017 Red Hat, Inc. All Rights Reserved.