Search in sources :

Example 11 with Status

use of org.hibernate.engine.spi.Status in project hibernate-orm by hibernate.

the class DefaultFlushEntityEventListener method getValues.

private Object[] getValues(Object entity, EntityEntry entry, boolean mightBeDirty, SessionImplementor session) {
    final Object[] loadedState = entry.getLoadedState();
    final Status status = entry.getStatus();
    final EntityPersister persister = entry.getPersister();
    final Object[] values;
    if (status == Status.DELETED) {
        // grab its state saved at deletion
        values = entry.getDeletedState();
    } else if (!mightBeDirty && loadedState != null) {
        values = loadedState;
    } else {
        checkId(entity, persister, entry.getId(), session);
        // grab its current state
        values = persister.getPropertyValues(entity);
        checkNaturalId(persister, entry, values, loadedState, session);
    }
    return values;
}
Also used : Status(org.hibernate.engine.spi.Status) EntityPersister(org.hibernate.persister.entity.EntityPersister)

Aggregations

Status (org.hibernate.engine.spi.Status)11 EntityEntry (org.hibernate.engine.spi.EntityEntry)6 EntityPersister (org.hibernate.persister.entity.EntityPersister)5 EventSource (org.hibernate.event.spi.EventSource)3 IdentityHashMap (java.util.IdentityHashMap)2 Map (java.util.Map)2 IdentityMap (org.hibernate.internal.util.collections.IdentityMap)2 AssertionFailure (org.hibernate.AssertionFailure)1 EntityUpdateAction (org.hibernate.action.internal.EntityUpdateAction)1 CascadePoint (org.hibernate.engine.internal.CascadePoint)1 Nullability (org.hibernate.engine.internal.Nullability)1 CollectionEntry (org.hibernate.engine.spi.CollectionEntry)1 SessionImplementor (org.hibernate.engine.spi.SessionImplementor)1 FlushEntityEvent (org.hibernate.event.spi.FlushEntityEvent)1 FlushEntityEventListener (org.hibernate.event.spi.FlushEntityEventListener)1 Type (org.hibernate.type.Type)1