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 ofCustomEntityDirtinessStrategy
which 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 DefaultCustomEntityDirtinessStrategy
INSTANCE
-
Constructor Summary
Constructors Constructor Description DefaultCustomEntityDirtinessStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canDirtyCheck(Object entity, EntityPersister persister, Session session)
Is this strategy capable of telling whether the given entity is dirty? A return oftrue
means 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.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.boolean
isDirty(Object entity, EntityPersister persister, Session session)
The callback used by Hibernate to determine if the given entity is dirty.void
resetDirty(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:CustomEntityDirtinessStrategy
Is this strategy capable of telling whether the given entity is dirty? A return oftrue
means 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:
canDirtyCheck
in interfaceCustomEntityDirtinessStrategy
- Parameters:
entity
- The entity to be checkedpersister
- The persister corresponding to the given entitysession
- The session from which this check originates.- Returns:
true
indicates the dirty check can be done;false
indicates it cannot.
-
isDirty
public boolean isDirty(Object entity, EntityPersister persister, Session session)
Description copied from interface:CustomEntityDirtinessStrategy
The 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:
isDirty
in interfaceCustomEntityDirtinessStrategy
- Parameters:
entity
- The entity to check.persister
- The persister corresponding to the given entitysession
- The session from which this check originates.- Returns:
true
indicates the entity is dirty;false
indicates the entity is not dirty.
-
resetDirty
public void resetDirty(Object entity, EntityPersister persister, Session session)
Description copied from interface:CustomEntityDirtinessStrategy
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.- Specified by:
resetDirty
in 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:CustomEntityDirtinessStrategy
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.AttributeChecker
implementation.- Specified by:
findDirty
in 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
-
-