Top Inners Fields Constructors Methods
org.hibernate.loader.entity

public Class CacheEntityLoaderHelper

extends AbstractLockUpgradeEventListener
Class Inheritance
Imports
java.io.Serializable, org.hibernate.HibernateException, .LockMode, .WrongClassException, org.hibernate.cache.spi.access.EntityDataAccess, org.hibernate.cache.spi.entry.CacheEntry, .ReferenceCacheEntryImpl, .StandardCacheEntryImpl, org.hibernate.engine.internal.CacheHelper, .ManagedTypeHelper, .StatefulPersistenceContext, .TwoPhaseLoad, .Versioning, org.hibernate.engine.spi.EntityEntry, .EntityKey, .ManagedEntity, .PersistenceContext, .SessionFactoryImplementor, .SessionImplementor, .Status, org.hibernate.event.internal.AbstractLockUpgradeEventListener, org.hibernate.event.spi.EventSource, .LoadEvent, .LoadEventListener, .PostLoadEvent, org.hibernate.internal.CoreLogging, .CoreMessageLogger, org.hibernate.persister.entity.EntityPersister, org.hibernate.pretty.MessageHelper, org.hibernate.proxy.HibernateProxy, org.hibernate.stat.internal.StatsHelper, org.hibernate.stat.spi.StatisticsImplementor, org.hibernate.type.Type, .TypeHelper

Author
Vlad Mihalcea

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
public static class

Field Summary

Modifier and TypeField and Description
public static final CacheEntityLoaderHelper
private static final CoreMessageLogger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private Object
private Object
convertCacheReferenceEntryToEntity(ReferenceCacheEntryImpl referenceCacheEntry, EventSource session, EntityKey entityKey)

Deprecated as a consequence of EventSource being deprecated.
private Object
getFromSharedCache(final LoadEvent event, final EntityPersister persister, SessionImplementor source)

Deprecated as a consequence of SessionImplementor being deprecated.
public Object

Returns:

The entity from the second-level cache, or null.
loadFromSecondLevelCache
(final LoadEvent
The load event
event
,
final EntityPersister
The persister for the entity being requested for load
persister
,
final EntityKey entityKey)

Attempts to load the entity from the second-level cache.

public CacheEntityLoaderHelper.PersistenceContextEntry

Returns:

The entity from the session-level cache, or null.
loadFromSessionCache
(final LoadEvent
The load event
event
,
final EntityKey
The EntityKey representing the entity to be loaded.
keyToLoad
,
final LoadEventListener.LoadType
The load options.
options
)

Attempts to locate the entity in the session-level cache.

private void
makeEntityCircularReferenceSafe(ReferenceCacheEntryImpl referenceCacheEntry, EventSource session, Object entity, EntityKey entityKey)

Deprecated as a consequence of EventSource being deprecated.
private Object
processCachedEntry(final LoadEvent event, final EntityPersister persister, final Object ce, final SessionImplementor source, final EntityKey entityKey)

Deprecated as a consequence of SessionImplementor being deprecated.
Inherited from org.hibernate.event.internal.AbstractLockUpgradeEventListener:
upgradeLock

Field Detail

INSTANCEback to summary
public static final CacheEntityLoaderHelper INSTANCE
LOGback to summary
private static final CoreMessageLogger LOG

Constructor Detail

CacheEntityLoaderHelperback to summary
private CacheEntityLoaderHelper()

Method Detail

convertCacheEntryToEntityback to summary
private Object convertCacheEntryToEntity(CacheEntry entry, Serializable entityId, EntityPersister persister, LoadEvent event, EntityKey entityKey)
convertCacheReferenceEntryToEntityback to summary
private Object convertCacheReferenceEntryToEntity(ReferenceCacheEntryImpl referenceCacheEntry, EventSource session, EntityKey entityKey)

Deprecated

as a consequence of EventSource being deprecated. See corresponding docs for further information.

getFromSharedCacheback to summary
private Object getFromSharedCache(final LoadEvent event, final EntityPersister persister, SessionImplementor source)

Deprecated

as a consequence of SessionImplementor being deprecated. See corresponding docs for further information.

loadFromSecondLevelCacheback to summary
public Object loadFromSecondLevelCache(final LoadEvent event, final EntityPersister persister, final EntityKey entityKey)

Attempts to load the entity from the second-level cache.

Parameters
event:LoadEvent

The load event

persister:EntityPersister

The persister for the entity being requested for load

Returns:Object

The entity from the second-level cache, or null.

loadFromSessionCacheback to summary
public CacheEntityLoaderHelper.PersistenceContextEntry loadFromSessionCache(final LoadEvent event, final EntityKey keyToLoad, final LoadEventListener.LoadType options) throws HibernateException

Attempts to locate the entity in the session-level cache.

If allowed to return nulls, then if the entity happens to be found in the session cache, we check the entity type for proper handling of entity hierarchies.

If checkDeleted was set to true, then if the entity is found in the session-level cache, it's current status within the session cache is checked to see if it has previously been scheduled for deletion.

Parameters
event:LoadEvent

The load event

keyToLoad:EntityKey

The EntityKey representing the entity to be loaded.

options:LoadEventListener.LoadType

The load options.

Returns:CacheEntityLoaderHelper.PersistenceContextEntry

The entity from the session-level cache, or null.

Exceptions
HibernateException:
Generally indicates problems applying a lock-mode.
makeEntityCircularReferenceSafeback to summary
private void makeEntityCircularReferenceSafe(ReferenceCacheEntryImpl referenceCacheEntry, EventSource session, Object entity, EntityKey entityKey)

Deprecated

as a consequence of EventSource being deprecated. See corresponding docs for further information.

processCachedEntryback to summary
private Object processCachedEntry(final LoadEvent event, final EntityPersister persister, final Object ce, final SessionImplementor source, final EntityKey entityKey)

Deprecated

as a consequence of SessionImplementor being deprecated. See corresponding docs for further information.

org.hibernate.loader.entity back to summary

public final Enum CacheEntityLoaderHelper.EntityStatus

extends Enum<CacheEntityLoaderHelper.EntityStatus>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final CacheEntityLoaderHelper.EntityStatus
public static final CacheEntityLoaderHelper.EntityStatus
public static final CacheEntityLoaderHelper.EntityStatus

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static CacheEntityLoaderHelper.EntityStatus
public static CacheEntityLoaderHelper.EntityStatus[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INCONSISTENT_RTN_CLASS_MARKERback to summary
public static final CacheEntityLoaderHelper.EntityStatus INCONSISTENT_RTN_CLASS_MARKER
MANAGEDback to summary
public static final CacheEntityLoaderHelper.EntityStatus MANAGED
REMOVED_ENTITY_MARKERback to summary
public static final CacheEntityLoaderHelper.EntityStatus REMOVED_ENTITY_MARKER

Constructor Detail

EntityStatusback to summary
private EntityStatus()

Method Detail

valueOfback to summary
public static CacheEntityLoaderHelper.EntityStatus valueOf(String name)
valuesback to summary
public static CacheEntityLoaderHelper.EntityStatus[] values()
org.hibernate.loader.entity back to summary

public Class CacheEntityLoaderHelper.PersistenceContextEntry

extends Object
Class Inheritance
  • java.lang.Object
  • org.hibernate.loader.entity.CacheEntityLoaderHelper.PersistenceContextEntry

Field Summary

Modifier and TypeField and Description
private final Object
private CacheEntityLoaderHelper.EntityStatus

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
public CacheEntityLoaderHelper.EntityStatus
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

entityback to summary
private final Object entity
statusback to summary
private CacheEntityLoaderHelper.EntityStatus status

Constructor Detail

PersistenceContextEntryback to summary
public PersistenceContextEntry(Object entity, CacheEntityLoaderHelper.EntityStatus status)

Method Detail

getEntityback to summary
public Object getEntity()
getStatusback to summary
public CacheEntityLoaderHelper.EntityStatus getStatus()
isManagedback to summary
public boolean isManaged()