类 DefaultSaveOrUpdateEventListener
- java.lang.Object
-
- org.hibernate.event.internal.AbstractReassociateEventListener
-
- org.hibernate.event.internal.AbstractSaveEventListener
-
- org.hibernate.event.internal.DefaultSaveOrUpdateEventListener
-
public class DefaultSaveOrUpdateEventListener extends AbstractSaveEventListener implements SaveOrUpdateEventListener
Defines the default listener used by Hibernate for handling save-update events.- 作者:
- Steve Ebersole, Gavin King
- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 构造器 说明 DefaultSaveOrUpdateEventListener()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected voidentityIsDetached(SaveOrUpdateEvent event)The given save-update event named a detached entity.protected SerializableentityIsPersistent(SaveOrUpdateEvent event)protected SerializableentityIsTransient(SaveOrUpdateEvent event)The given save-update event named a transient entity.protected CascadingActiongetCascadeAction()protected SerializablegetUpdateId(Object entity, EntityPersister persister, Serializable requestedId, SessionImplementor session)Determine the id to use for updating.protected booleaninvokeUpdateLifecycle(Object entity, EntityPersister persister, EventSource source)voidonSaveOrUpdate(SaveOrUpdateEvent event)Handle the given update event.protected SerializableperformSaveOrUpdate(SaveOrUpdateEvent event)protected voidperformUpdate(SaveOrUpdateEvent event, Object entity, EntityPersister persister)protected booleanreassociateIfUninitializedProxy(Object object, SessionImplementor source)protected SerializablesaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)Save the transient instance, assigning the right identifier-
从类继承的方法 org.hibernate.event.internal.AbstractSaveEventListener
cascadeAfterSave, cascadeBeforeSave, getMergeMap, injectCallbackRegistry, invokeSaveLifecycle, isVersionIncrementDisabled, performSave, performSaveOrReplicate, saveWithGeneratedId, saveWithRequestedId, substituteValuesIfNecessary, visitCollectionsBeforeSave
-
从类继承的方法 org.hibernate.event.internal.AbstractReassociateEventListener
reassociate
-
-
-
-
方法详细资料
-
onSaveOrUpdate
public void onSaveOrUpdate(SaveOrUpdateEvent event)
Handle the given update event.- 指定者:
onSaveOrUpdate在接口中SaveOrUpdateEventListener- 参数:
event- The update event to be handled.
-
reassociateIfUninitializedProxy
protected boolean reassociateIfUninitializedProxy(Object object, SessionImplementor source)
-
performSaveOrUpdate
protected Serializable performSaveOrUpdate(SaveOrUpdateEvent event)
-
entityIsPersistent
protected Serializable entityIsPersistent(SaveOrUpdateEvent event) throws HibernateException
-
entityIsTransient
protected Serializable entityIsTransient(SaveOrUpdateEvent event)
The given save-update event named a transient entity. Here, we will perform the save processing.- 参数:
event- The save event to be handled.- 返回:
- The entity's identifier after saving.
-
saveWithGeneratedOrRequestedId
protected Serializable saveWithGeneratedOrRequestedId(SaveOrUpdateEvent event)
Save the transient instance, assigning the right identifier- 参数:
event- The initiating event.- 返回:
- The entity's identifier value after saving.
-
entityIsDetached
protected void entityIsDetached(SaveOrUpdateEvent event)
The given save-update event named a detached entity. Here, we will perform the update processing.- 参数:
event- The update event to be handled.
-
getUpdateId
protected Serializable getUpdateId(Object entity, EntityPersister persister, Serializable requestedId, SessionImplementor session)
Determine the id to use for updating.- 参数:
entity- The entity.persister- The entity persisterrequestedId- The requested identifiersession- The session- 返回:
- The id.
- 抛出:
TransientObjectException- If the entity is considered transient.
-
performUpdate
protected void performUpdate(SaveOrUpdateEvent event, Object entity, EntityPersister persister) throws HibernateException
-
invokeUpdateLifecycle
protected boolean invokeUpdateLifecycle(Object entity, EntityPersister persister, EventSource source)
-
getCascadeAction
protected CascadingAction getCascadeAction()
-
-