Package org.hibernate.loader.entity
Class CacheEntityLoaderHelper
- java.lang.Object
-
- org.hibernate.event.internal.AbstractReassociateEventListener
-
- org.hibernate.event.internal.AbstractLockUpgradeEventListener
-
- org.hibernate.loader.entity.CacheEntityLoaderHelper
-
- All Implemented Interfaces:
java.io.Serializable
public class CacheEntityLoaderHelper extends org.hibernate.event.internal.AbstractLockUpgradeEventListener
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CacheEntityLoaderHelper.EntityStatus
static class
CacheEntityLoaderHelper.PersistenceContextEntry
-
Field Summary
Fields Modifier and Type Field Description static CacheEntityLoaderHelper
INSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
loadFromSecondLevelCache(LoadEvent event, EntityPersister persister, EntityKey entityKey)
Attempts to load the entity from the second-level cache.CacheEntityLoaderHelper.PersistenceContextEntry
loadFromSessionCache(LoadEvent event, EntityKey keyToLoad, LoadEventListener.LoadType options)
Attempts to locate the entity in the session-level cache.-
Methods inherited from class org.hibernate.event.internal.AbstractLockUpgradeEventListener
upgradeLock
-
-
-
-
Field Detail
-
INSTANCE
public static final CacheEntityLoaderHelper INSTANCE
-
-
Method Detail
-
loadFromSessionCache
public CacheEntityLoaderHelper.PersistenceContextEntry loadFromSessionCache(LoadEvent event, EntityKey keyToLoad, 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
- The load eventkeyToLoad
- The EntityKey representing the entity to be loaded.options
- The load options.- Returns:
- The entity from the session-level cache, or null.
- Throws:
HibernateException
- Generally indicates problems applying a lock-mode.
-
loadFromSecondLevelCache
public java.lang.Object loadFromSecondLevelCache(LoadEvent event, EntityPersister persister, EntityKey entityKey)
Attempts to load the entity from the second-level cache.- Parameters:
event
- The load eventpersister
- The persister for the entity being requested for load- Returns:
- The entity from the second-level cache, or null.
-
-