Package org.hibernate.boot.internal
Class DefaultCustomEntityDirtinessStrategy
- java.lang.Object
-
- org.hibernate.boot.internal.DefaultCustomEntityDirtinessStrategy
-
- All Implemented Interfaces:
CustomEntityDirtinessStrategy
public class DefaultCustomEntityDirtinessStrategy extends Object implements CustomEntityDirtinessStrategy
The default implementation ofCustomEntityDirtinessStrategywhich does nada.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.CustomEntityDirtinessStrategy
CustomEntityDirtinessStrategy.AttributeChecker, CustomEntityDirtinessStrategy.AttributeInformation, CustomEntityDirtinessStrategy.DirtyCheckContext
-
-
Field Summary
Fields Modifier and Type Field Description static DefaultCustomEntityDirtinessStrategyINSTANCE
-
Constructor Summary
Constructors Constructor Description DefaultCustomEntityDirtinessStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDirtyCheck(Object entity, EntityPersister persister, Session session)Is this strategy capable of telling whether the given entity is dirty? A return oftruemeans thatCustomEntityDirtinessStrategy.isDirty(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.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.
-
-
-
Field Detail
-
INSTANCE
public static final DefaultCustomEntityDirtinessStrategy INSTANCE
-
-
Method Detail
-
canDirtyCheck
public boolean canDirtyCheck(Object entity, EntityPersister persister, Session session)
Description copied from interface:CustomEntityDirtinessStrategyIs this strategy capable of telling whether the given entity is dirty? A return oftruemeans thatCustomEntityDirtinessStrategy.isDirty(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.- Specified by:
canDirtyCheckin interfaceCustomEntityDirtinessStrategy- Parameters:
entity- The entity to be checkedpersister- The persister corresponding to the given entitysession- The session from which this check originates.- Returns:
trueindicates the dirty check can be done;falseindicates it cannot.
-
isDirty
public boolean isDirty(Object entity, EntityPersister persister, Session session)
Description copied from interface:CustomEntityDirtinessStrategyThe callback used by Hibernate to determine if the given entity is dirty. Only called if the previousCustomEntityDirtinessStrategy.canDirtyCheck(java.lang.Object, org.hibernate.persister.entity.EntityPersister, org.hibernate.Session)returnedtrue- Specified by:
isDirtyin interfaceCustomEntityDirtinessStrategy- Parameters:
entity- The entity to check.persister- The persister corresponding to the given entitysession- The session from which this check originates.- Returns:
trueindicates the entity is dirty;falseindicates the entity is not dirty.
-
resetDirty
public void resetDirty(Object entity, EntityPersister persister, Session session)
Description copied from interface:CustomEntityDirtinessStrategyCallback 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.- Specified by:
resetDirtyin interfaceCustomEntityDirtinessStrategy- Parameters:
entity- The entity to resetpersister- The persister corresponding to the given entitysession- The session from which this call originates.
-
findDirty
public void findDirty(Object entity, EntityPersister persister, Session session, CustomEntityDirtinessStrategy.DirtyCheckContext dirtyCheckContext)
Description copied from interface:CustomEntityDirtinessStrategyCallback 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.- Specified by:
findDirtyin interfaceCustomEntityDirtinessStrategy- Parameters:
entity- The entity being checkedpersister- The persister corresponding to the given entitysession- The session from which this call originates.dirtyCheckContext- The callback context
-
-