程序包 org.hibernate
接口 CustomEntityDirtinessStrategy
-
- 所有已知实现类:
DefaultCustomEntityDirtinessStrategy
public interface CustomEntityDirtinessStrategyDuring a flush cycle, Hibernate needs to determine which of the entities associated with aSession. Dirty entities are the ones that get UPDATEed to the database. In some circumstances, that process of determining whether an entity is dirty can take a significant time as by default Hibernate must check each of the entity's attribute values one-by-one. Oftentimes applications already have knowledge of an entity's dirtiness and using that information instead would be more performant. The purpose of this contract then is to allow applications such a plug-in point.- 作者:
- Steve Ebersole
-
-
嵌套类概要
嵌套类 修饰符和类型 接口 说明 static interfaceCustomEntityDirtinessStrategy.AttributeCheckerResponsible for identifying when attributes are dirty.static interfaceCustomEntityDirtinessStrategy.AttributeInformationProvidesCustomEntityDirtinessStrategy.AttributeCheckerwith meta information about the attributes being checked.static interfaceCustomEntityDirtinessStrategy.DirtyCheckContextA callback to drive dirty checking.
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 booleancanDirtyCheck(Object entity, EntityPersister persister, Session session)Is this strategy capable of telling whether the given entity is dirty?voidfindDirty(Object entity, EntityPersister persister, Session session, CustomEntityDirtinessStrategy.DirtyCheckContext dirtyCheckContext)Callback used to hook into Hibernate algorithm for determination of which attributes have changed.booleanisDirty(Object entity, EntityPersister persister, Session session)The callback used by Hibernate to determine if the given entity is dirty.voidresetDirty(Object entity, EntityPersister persister, Session session)Callback used by Hibernate to signal that the entity dirty flag should be cleared.
-
-
-
方法详细资料
-
canDirtyCheck
boolean canDirtyCheck(Object entity, EntityPersister persister, Session session)
Is this strategy capable of telling whether the given entity is dirty? A return oftruemeans thatisDirty(java.lang.Object, org.hibernate.persister.entity.EntityPersister, org.hibernate.Session)will be called next as the definitive means to determine whether the entity is dirty.- 参数:
entity- The entity to be check.persister- The persister corresponding to the given entitysession- The session from which this check originates.- 返回:
trueindicates the dirty check can be done;falseindicates it cannot.
-
isDirty
boolean isDirty(Object entity, EntityPersister persister, Session session)
The callback used by Hibernate to determine if the given entity is dirty. Only called if the previouscanDirtyCheck(java.lang.Object, org.hibernate.persister.entity.EntityPersister, org.hibernate.Session)returnedtrue- 参数:
entity- The entity to check.persister- The persister corresponding to the given entitysession- The session from which this check originates.- 返回:
trueindicates the entity is dirty;falseindicates the entity is not dirty.
-
resetDirty
void resetDirty(Object entity, EntityPersister persister, Session session)
Callback used by Hibernate to signal that the entity dirty flag should be cleared. Generally this happens after previous dirty changes were written to the database.- 参数:
entity- The entity to resetpersister- The persister corresponding to the given entitysession- The session from which this call originates.
-
findDirty
void findDirty(Object entity, EntityPersister persister, Session session, CustomEntityDirtinessStrategy.DirtyCheckContext dirtyCheckContext)
Callback used to hook into Hibernate algorithm for determination of which attributes have changed. Applications wanting to hook in to this would call back into the givenCustomEntityDirtinessStrategy.DirtyCheckContext.doDirtyChecking(org.hibernate.CustomEntityDirtinessStrategy.AttributeChecker)method passing along an appropriateCustomEntityDirtinessStrategy.AttributeCheckerimplementation.- 参数:
entity- The entity being checkedpersister- The persister corresponding to the given entitysession- The session from which this call originates.dirtyCheckContext- The callback context
-
-