Top Description Fields Constructors Methods
org.hibernate.engine

public final Class TwoPhaseLoad

extends Object
Class Inheritance
Imports
java.io.Serializable, org.slf4j.Logger, .LoggerFactory, org.hibernate.AssertionFailure, .CacheMode, .HibernateException, .LockMode, org.hibernate.proxy.HibernateProxy, org.hibernate.cache.CacheKey, org.hibernate.cache.entry.CacheEntry, org.hibernate.event.PostLoadEvent, .PostLoadEventListener, .PreLoadEvent, .PreLoadEventListener, org.hibernate.intercept.LazyPropertyInitializer, org.hibernate.persister.entity.EntityPersister, org.hibernate.pretty.MessageHelper, org.hibernate.property.BackrefPropertyAccessor, org.hibernate.type.Type, .TypeHelper

Functionality relating to Hibernate's two-phase loading process, that may be reused by persisters that do not use the Loader framework
Author
Gavin King

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
addUninitializedCachedEntity(final EntityKey key, final Object object, final EntityPersister persister, final LockMode lockMode, final boolean lazyPropertiesAreUnfetched, final Object version, final SessionImplementor session)

public static void
addUninitializedEntity(final EntityKey key, final Object object, final EntityPersister persister, final LockMode lockMode, final boolean lazyPropertiesAreUnfetched, final SessionImplementor session)

Add an uninitialized instance of an entity class, as a placeholder to ensure object identity.

public static void
initializeEntity(final Object entity, final boolean readOnly, final SessionImplementor session, final PreLoadEvent preLoadEvent, final PostLoadEvent postLoadEvent)

Perform the second step of 2-phase load.

public static void
postHydrate(final EntityPersister persister, final Serializable id, final Object[] values, final Object rowId, final Object object, final LockMode lockMode, final boolean lazyPropertiesAreUnfetched, final SessionImplementor session)

Register the "hydrated" state of an entity instance, after the first step of 2-phase loading.

private static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

logback to summary
private static final Logger log

Constructor Detail

TwoPhaseLoadback to summary
private TwoPhaseLoad()

Method Detail

addUninitializedCachedEntityback to summary
public static void addUninitializedCachedEntity(final EntityKey key, final Object object, final EntityPersister persister, final LockMode lockMode, final boolean lazyPropertiesAreUnfetched, final Object version, final SessionImplementor session)
addUninitializedEntityback to summary
public static void addUninitializedEntity(final EntityKey key, final Object object, final EntityPersister persister, final LockMode lockMode, final boolean lazyPropertiesAreUnfetched, final SessionImplementor session)

Add an uninitialized instance of an entity class, as a placeholder to ensure object identity. Must be called before postHydrate(). Create a "temporary" entry for a newly instantiated entity. The entity is uninitialized, but we need the mapping from id to instance in order to guarantee uniqueness.

initializeEntityback to summary
public static void initializeEntity(final Object entity, final boolean readOnly, final SessionImplementor session, final PreLoadEvent preLoadEvent, final PostLoadEvent postLoadEvent) throws HibernateException

Perform the second step of 2-phase load. Fully initialize the entity instance. After processing a JDBC result set, we "resolve" all the associations between the entities which were instantiated and had their state "hydrated" into an array

postHydrateback to summary
public static void postHydrate(final EntityPersister persister, final Serializable id, final Object[] values, final Object rowId, final Object object, final LockMode lockMode, final boolean lazyPropertiesAreUnfetched, final SessionImplementor session) throws HibernateException

Register the "hydrated" state of an entity instance, after the first step of 2-phase loading. Add the "hydrated state" (an array) of an uninitialized entity to the session. We don't try to resolve any associations yet, because there might be other entities waiting to be read from the JDBC result set we are currently processing

useMinimalPutsback to summary
private static boolean useMinimalPuts(SessionImplementor session, EntityEntry entityEntry)