Session.
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.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | CustomEntityDirtinessStrategy.AttributeChecker
Responsible for identifying when attributes are dirty. |
| public static interface | CustomEntityDirtinessStrategy.AttributeInformation
Provides |
| public static interface | CustomEntityDirtinessStrategy.DirtyCheckContext
A callback to drive dirty checking. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true indicates the dirty check can be done; false indicates it cannot.The entity to be check. entity, EntityPersister The persister corresponding to the given entity persister, Session The session from which this check originates. session)
Deprecated
as a consequence of
Is this strategy capable of telling whether the given entity is dirty?
Session being deprecated.
|
| public void | findDirty(Object
The entity being checked entity, EntityPersister The persister corresponding to the given entity persister, Session The session from which this call originates. session, CustomEntityDirtinessStrategy.The callback context dirtyCheckContext
Deprecated
as a consequence of
Callback used to hook into Hibernate algorithm for determination of which attributes have changed.
Session being deprecated.
|
| public boolean | Returns: true indicates the entity is dirty; false indicates the entity is not dirty.The entity to check. entity, EntityPersister The persister corresponding to the given entity persister, Session The session from which this check originates. session)
Deprecated
as a consequence of
The callback used by Hibernate to determine if the given entity is dirty.
Session being deprecated.
|
| public void | resetDirty(Object
The entity to reset entity, EntityPersister The persister corresponding to the given entity persister, Session The session from which this call originates. session)
Deprecated
as a consequence of
Callback used by Hibernate to signal that the entity dirty flag should be cleared.
Session being deprecated.
|
| canDirtyCheck | back to summary |
|---|---|
| public boolean canDirtyCheck(Object entity, EntityPersister persister, Session session)
Deprecated as a consequence of Is this strategy capable of telling whether the given entity is dirty? A return of
| |
| findDirty | back to summary |
|---|---|
| public void findDirty(Object entity, EntityPersister persister, Session session, CustomEntityDirtinessStrategy. Deprecated as a consequence of 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 given
| |
| isDirty | back to summary |
|---|---|
| public boolean isDirty(Object entity, EntityPersister persister, Session session)
Deprecated as a consequence of The callback used by Hibernate to determine if the given entity is dirty. Only called if the previous
| |
| resetDirty | back to summary |
|---|---|
| public void resetDirty(Object entity, EntityPersister persister, Session session)
Deprecated as a consequence of 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.
| |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true indicates the attribute value has changed; false indicates it has not.Information about the attribute which is useful to help determine if it is
dirty. attributeInformationDo the attribute dirty check. |
| isDirty | back to summary |
|---|---|
| public boolean isDirty(CustomEntityDirtinessStrategy. Do the attribute dirty check.
| |
AttributeChecker with meta information about the attributes being checked.
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: The attribute index.Many of Hibernate internals use arrays to define information about attributes. |
| public EntityPersister | Returns: The entity persister.Get a reference to the persister for the entity containing this attribute. |
| public Object | |
| public Object | |
| public String | |
| public Type |
| getAttributeIndex | back to summary |
|---|---|
| public int getAttributeIndex() Many of Hibernate internals use arrays to define information about attributes. This value provides this index into those arrays for this particular attribute. It can be useful if needing to leverage those Hibernate internals.
| |
| getContainingPersister | back to summary |
|---|---|
| public EntityPersister getContainingPersister() Get a reference to the persister for the entity containing this attribute.
| |
| getCurrentValue | back to summary |
|---|---|
| public Object getCurrentValue() Get the current value of this attribute.
| |
| getLoadedValue | back to summary |
|---|---|
| public Object getLoadedValue() Get the loaded value of this attribute. NOTE : A call to this method may require hitting the database in cases where the loaded state is not known. In those cases the db hit is incurred only once per entity, not for each attribute.
| |
| getName | back to summary |
|---|---|
| public String getName() Get the name of this attribute.
| |
| getType | back to summary |
|---|---|
| public Type getType() Get the mapping type of this attribute.
| |
CustomEntityDirtinessStrategy#findDirty method
so that it can callback on to it if it wants to handle dirty checking rather than using Hibernate's default
checking
| Modifier and Type | Method and Description |
|---|---|
| public void | doDirtyChecking(CustomEntityDirtinessStrategy.
The delegate usable by the context for determining which attributes are dirty. attributeCheckerThe callback to indicate that dirty checking (the dirty attribute determination phase) should be handled
by the calling |
| doDirtyChecking | back to summary |
|---|---|
| public void doDirtyChecking(CustomEntityDirtinessStrategy. The callback to indicate that dirty checking (the dirty attribute determination phase) should be handled
by the calling
| |