Top Inners Fields Constructors Methods
org.hibernate.loader.ast.internal

public Class CacheEntityLoaderHelper

extends Object
Class Inheritance
Imports
org.hibernate.HibernateException, .Incubating, .LockMode, .LockOptions, org.hibernate.bytecode.enhance.spi.interceptor.EnhancementAsProxyLazinessInterceptor, org.hibernate.cache.spi.access.EntityDataAccess, org.hibernate.cache.spi.entry.CacheEntry, .ReferenceCacheEntryImpl, .StandardCacheEntryImpl, org.hibernate.engine.internal.CacheHelper, .StatefulPersistenceContext, .TwoPhaseLoad, org.hibernate.engine.spi.EntityEntry, .EntityHolder, .EntityKey, .PersistenceContext, .PersistentAttributeInterceptor, .SessionFactoryImplementor, .SessionImplementor, .SharedSessionContractImplementor, .Status, 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.sql.results.LoadingLogger, 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
convertCacheEntryToEntity(CacheEntry entry, Object entityId, EventSource source, EntityPersister persister, Object instanceToLoad, EntityKey entityKey)

private Object
private Object
getFromSharedCache(final Object entityId, final EntityPersister persister, SessionImplementor source)

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
The entity key
entityKey
)

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

public Object

Returns:

The entity from the second-level cache, or null.
loadFromSecondLevelCache
(final EventSource
The source
source
,
final Object
The entity
entity
,
final LockMode
The lock mode
lockMode
,
final EntityPersister
The persister for the entity being requested for load
persister
,
final EntityKey
The entity key
entityKey
)

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

public CacheEntityLoaderHelper.PersistenceContextEntry
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.

public static CacheEntityLoaderHelper.PersistenceContextEntry

Returns:

The entity from the session-level cache, or null.
loadFromSessionCacheStatic
(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
private Object
processCachedEntry(final Object instanceToLoad, final EntityPersister persister, final Object ce, final EventSource source, final EntityKey entityKey)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

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, Object entityId, EventSource source, EntityPersister persister, Object instanceToLoad, EntityKey entityKey)
convertCacheReferenceEntryToEntityback to summary
private Object convertCacheReferenceEntryToEntity(ReferenceCacheEntryImpl referenceCacheEntry, SharedSessionContractImplementor session, EntityKey entityKey)
getFromSharedCacheback to summary
private Object getFromSharedCache(final Object entityId, final EntityPersister persister, SessionImplementor source)
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

entityKey:EntityKey

The entity key

Returns:Object

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

loadFromSecondLevelCacheback to summary
public Object loadFromSecondLevelCache(final EventSource source, final Object entity, final LockMode lockMode, final EntityPersister persister, final EntityKey entityKey)

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

Parameters
source:EventSource

The source

entity:Object

The entity

lockMode:LockMode

The lock mode

persister:EntityPersister

The persister for the entity being requested for load

entityKey:EntityKey

The entity key

Returns:Object

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

loadFromSessionCacheback to summary
public CacheEntityLoaderHelper.PersistenceContextEntry loadFromSessionCache(EntityKey keyToLoad, LoadEventListener.LoadType options, LockOptions lockOptions, EventSource session)
Annotations
@Incubating
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, its 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.
loadFromSessionCacheStaticback to summary
public static CacheEntityLoaderHelper.PersistenceContextEntry loadFromSessionCacheStatic(final LoadEvent event, final EntityKey keyToLoad, final LoadEventListener.LoadType options)

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, its 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, SharedSessionContractImplementor session, Object entity, EntityKey entityKey)
processCachedEntryback to summary
private Object processCachedEntry(final Object instanceToLoad, final EntityPersister persister, final Object ce, final EventSource source, final EntityKey entityKey)
org.hibernate.loader.ast.internal 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.ast.internal back to summary

public Class CacheEntityLoaderHelper.PersistenceContextEntry

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

Field Summary

Modifier and TypeField and Description
private final Object
private final 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 final 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()