|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.engine.spi.EntityEntry
public final class EntityEntry
We need an entry to tell us all about the current state of an object with respect to its persistent state
Constructor Summary | |
---|---|
EntityEntry(Status status,
Object[] loadedState,
Object rowId,
Serializable id,
Object version,
LockMode lockMode,
boolean existsInDatabase,
EntityPersister persister,
EntityMode entityMode,
String tenantId,
boolean disableVersionIncrement,
boolean lazyPropertiesAreUnfetched,
PersistenceContext persistenceContext)
|
Method Summary | |
---|---|
static EntityEntry |
deserialize(ObjectInputStream ois,
PersistenceContext persistenceContext)
Custom deserialization routine used during deserialization of a Session/PersistenceContext for increased performance. |
void |
forceLocked(Object entity,
Object nextVersion)
|
Object[] |
getDeletedState()
|
EntityKey |
getEntityKey()
Get the EntityKey based on this EntityEntry. |
String |
getEntityName()
|
Serializable |
getId()
|
Object[] |
getLoadedState()
|
Object |
getLoadedValue(String propertyName)
|
LockMode |
getLockMode()
|
EntityPersister |
getPersister()
|
Object |
getRowId()
|
Status |
getStatus()
|
Object |
getVersion()
|
boolean |
isBeingReplicated()
|
boolean |
isExistsInDatabase()
|
boolean |
isLoadedWithLazyPropertiesUnfetched()
|
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 |
boolean |
isNullifiable(boolean earlyInsert,
SessionImplementor session)
|
boolean |
isReadOnly()
|
void |
postDelete()
After actually deleting a row, record the fact that the instance no longer exists in the database |
void |
postInsert(Object[] insertedState)
After actually inserting a row, record the fact that the instance exists on the database (needed for identity-column key generation) |
void |
postUpdate(Object entity,
Object[] updatedState,
Object nextVersion)
Handle updating the internal state of the entry after actually performing the database update. |
boolean |
requiresDirtyCheck(Object entity)
Not sure this is the best method name, but the general idea here is to return true if the entity can
possibly be dirty. |
void |
serialize(ObjectOutputStream oos)
Custom serialization routine used during serialization of a Session/PersistenceContext for increased performance. |
void |
setDeletedState(Object[] deletedState)
|
void |
setLockMode(LockMode lockMode)
|
void |
setReadOnly(boolean readOnly,
Object entity)
|
void |
setStatus(Status status)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EntityEntry(Status status, Object[] loadedState, Object rowId, Serializable id, Object version, LockMode lockMode, boolean existsInDatabase, EntityPersister persister, EntityMode entityMode, String tenantId, boolean disableVersionIncrement, boolean lazyPropertiesAreUnfetched, PersistenceContext persistenceContext)
Method Detail |
---|
public LockMode getLockMode()
public void setLockMode(LockMode lockMode)
public Status getStatus()
public void setStatus(Status status)
public Serializable getId()
public Object[] getLoadedState()
public Object[] getDeletedState()
public void setDeletedState(Object[] deletedState)
public boolean isExistsInDatabase()
public Object getVersion()
public EntityPersister getPersister()
public EntityKey getEntityKey()
IllegalStateException
- if getId() is nullpublic String getEntityName()
public boolean isBeingReplicated()
public Object getRowId()
public void postUpdate(Object entity, Object[] updatedState, Object nextVersion)
entity
- The entity instanceupdatedState
- The state calculated after the update (becomes the
new loaded state
.nextVersion
- The new version.public void postDelete()
public void postInsert(Object[] insertedState)
public boolean isNullifiable(boolean earlyInsert, SessionImplementor session)
public Object getLoadedValue(String propertyName)
public boolean requiresDirtyCheck(Object entity)
true
if the entity can
possibly be dirty. This can only be the case if it is in a modifiable state (not read-only/deleted) and it
either has mutable properties or field-interception is not telling us it is dirty. Clear as mud? :/
A name like canPossiblyBeDirty might be better
entity
- The entity to test
true
indicates that the entity could possibly be dirty and that dirty check
should happen; false
indicates there is no way the entity can be dirtypublic boolean isModifiableEntity()
public void forceLocked(Object entity, Object nextVersion)
public boolean isReadOnly()
public void setReadOnly(boolean readOnly, Object entity)
public String toString()
toString
in class Object
public boolean isLoadedWithLazyPropertiesUnfetched()
public void serialize(ObjectOutputStream oos) throws IOException
oos
- The stream to which we should write the serial data.
IOException
- If a stream error occurspublic static EntityEntry deserialize(ObjectInputStream ois, PersistenceContext persistenceContext) throws IOException, ClassNotFoundException
ois
- The stream from which to read the entry.persistenceContext
- The context being deserialized.
IOException
- If a stream error occurs
ClassNotFoundException
- If any of the classes declared in the stream
cannot be found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |