public interface EntityEntry
Modifier and Type | Method and Description |
---|---|
void |
addExtraState(EntityEntryExtraState extraState) |
void |
forceLocked(Object entity,
Object nextVersion) |
Object[] |
getDeletedState() |
EntityKey |
getEntityKey()
Get the EntityKey based on this EntityEntry.
|
String |
getEntityName() |
<T extends EntityEntryExtraState> |
getExtraState(Class<T> extraStateType) |
Serializable |
getId() |
Object[] |
getLoadedState() |
Object |
getLoadedValue(String propertyName) |
LockMode |
getLockMode() |
EntityPersister |
getPersister() |
Object |
getRowId() |
Status |
getStatus() |
Object |
getVersion() |
boolean |
isBeingReplicated() |
boolean |
isExistsInDatabase() |
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,
SharedSessionContractImplementor session) |
boolean |
isReadOnly() |
void |
overwriteLoadedStateCollectionValue(String propertyName,
PersistentCollection collection) |
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() |
LockMode getLockMode()
void setLockMode(LockMode lockMode)
Status getStatus()
void setStatus(Status status)
Serializable getId()
Object[] getLoadedState()
void overwriteLoadedStateCollectionValue(String propertyName, PersistentCollection collection)
Object[] getDeletedState()
void setDeletedState(Object[] deletedState)
boolean isExistsInDatabase()
Object getVersion()
EntityPersister getPersister()
EntityKey getEntityKey()
IllegalStateException
- if getId() is nullString getEntityName()
boolean isBeingReplicated()
Object getRowId()
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.void postDelete()
void postInsert(Object[] insertedState)
boolean isNullifiable(boolean earlyInsert, SharedSessionContractImplementor session)
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 betterentity
- The entity to testtrue
indicates that the entity could possibly be dirty and that dirty check
should happen; false
indicates there is no way the entity can be dirtyboolean isModifiableEntity()
boolean isReadOnly()
void setReadOnly(boolean readOnly, Object entity)
void serialize(ObjectOutputStream oos) throws IOException
oos
- The stream to which we should write the serial data.IOException
- If a stream error occursvoid addExtraState(EntityEntryExtraState extraState)
<T extends EntityEntryExtraState> T getExtraState(Class<T> extraStateType)
Copyright © 2021 JBoss by Red Hat. All rights reserved.