Package org.hibernate.engine
Class EntityEntry
java.lang.Object
org.hibernate.engine.EntityEntry
- All Implemented Interfaces:
Serializable
We need an entry to tell us all about the current state
of an object with respect to its persistent state
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidforceLocked(Object entity, Object nextVersion) Object[]Get the EntityKey based on this EntityEntry.getId()Object[]getLoadedValue(String propertyName) getRowId()booleanbooleanbooleanbooleanCan the entity be modified? The entity is modifiable if all of the following are true: the entity class is mutable the entity is not read-only if the current status is Status.DELETED, then the entity was not read-only when it was deletedbooleanisNullifiable(boolean earlyInsert, SessionImplementor session) booleanvoidAfter actually deleting a row, record the fact that the instance no longer exists in the databasevoidAfter actually inserting a row, record the fact that the instance exists on the database (needed for identity-column key generation)voidpostUpdate(Object entity, Object[] updatedState, Object nextVersion) Handle updating the internal state of the entry after actually performing the database update.booleanrequiresDirtyCheck(Object entity) voidsetDeletedState(Object[] deletedState) voidsetLockMode(LockMode lockMode) voidsetReadOnly(boolean readOnly, Object entity) voidtoString()
-
Method Details
-
getLockMode
-
setLockMode
-
getStatus
-
setStatus
-
getId
-
getLoadedState
-
getDeletedState
-
setDeletedState
-
isExistsInDatabase
public boolean isExistsInDatabase() -
getVersion
-
getPersister
-
getEntityKey
Get the EntityKey based on this EntityEntry.- Returns:
- the EntityKey
- Throws:
IllegalStateException- if getId() is null
-
getEntityName
-
isBeingReplicated
public boolean isBeingReplicated() -
getRowId
-
postUpdate
Handle updating the internal state of the entry after actually performing the database update. Specifically we update the snapshot information and escalate the lock mode- Parameters:
entity- The entity instanceupdatedState- The state calculated after the update (becomes the newloaded state.nextVersion- The new version.
-
postDelete
public void postDelete()After actually deleting a row, record the fact that the instance no longer exists in the database -
postInsert
public void postInsert()After actually inserting a row, record the fact that the instance exists on the database (needed for identity-column key generation) -
isNullifiable
-
getLoadedValue
-
requiresDirtyCheck
-
isModifiableEntity
public boolean isModifiableEntity()Can the entity be modified? The entity is modifiable if all of the following are true:- the entity class is mutable
- the entity is not read-only
- if the current status is Status.DELETED, then the entity was not read-only when it was deleted
- Returns:
- true, if the entity is modifiable; false, otherwise,
-
forceLocked
-
isReadOnly
public boolean isReadOnly() -
setReadOnly
-
toString
-
isLoadedWithLazyPropertiesUnfetched
public boolean isLoadedWithLazyPropertiesUnfetched()
-