Class EntityEntry

java.lang.Object
org.hibernate.engine.EntityEntry
All Implemented Interfaces:
Serializable

public final class EntityEntry extends Object implements 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 Details

    • getLockMode

      public LockMode getLockMode()
    • setLockMode

      public void setLockMode(LockMode lockMode)
    • getStatus

      public Status getStatus()
    • setStatus

      public void setStatus(Status status)
    • getId

      public Serializable getId()
    • getLoadedState

      public Object[] getLoadedState()
    • getDeletedState

      public Object[] getDeletedState()
    • setDeletedState

      public void setDeletedState(Object[] deletedState)
    • isExistsInDatabase

      public boolean isExistsInDatabase()
    • getVersion

      public Object getVersion()
    • getPersister

      public EntityPersister getPersister()
    • getEntityKey

      public EntityKey getEntityKey()
      Get the EntityKey based on this EntityEntry.
      Returns:
      the EntityKey
      Throws:
      IllegalStateException - if getId() is null
    • getEntityName

      public String getEntityName()
    • isBeingReplicated

      public boolean isBeingReplicated()
    • getRowId

      public Object getRowId()
    • postUpdate

      public void postUpdate(Object entity, Object[] updatedState, Object nextVersion)
      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 instance
      updatedState - The state calculated after the update (becomes the new loaded 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

      public boolean isNullifiable(boolean earlyInsert, SessionImplementor session)
    • getLoadedValue

      public Object getLoadedValue(String propertyName)
    • requiresDirtyCheck

      public boolean requiresDirtyCheck(Object entity)
    • 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

      public void forceLocked(Object entity, Object nextVersion)
    • isReadOnly

      public boolean isReadOnly()
    • setReadOnly

      public void setReadOnly(boolean readOnly, Object entity)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isLoadedWithLazyPropertiesUnfetched

      public boolean isLoadedWithLazyPropertiesUnfetched()