|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.event.def.AbstractReassociateEventListener org.hibernate.event.def.AbstractLockUpgradeEventListener org.hibernate.event.def.DefaultLoadEventListener
public class DefaultLoadEventListener
Defines the default load event listeners used by hibernate for loading entities in response to generated load events.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.hibernate.event.LoadEventListener |
---|
LoadEventListener.LoadType |
Field Summary | |
---|---|
static LockMode |
DEFAULT_LOCK_MODE
|
static Object |
INCONSISTENT_RTN_CLASS_MARKER
|
static Object |
REMOVED_ENTITY_MARKER
|
Fields inherited from interface org.hibernate.event.LoadEventListener |
---|
GET, IMMEDIATE_LOAD, INTERNAL_LOAD_EAGER, INTERNAL_LOAD_LAZY, INTERNAL_LOAD_NULLABLE, LOAD, RELOAD |
Constructor Summary | |
---|---|
DefaultLoadEventListener()
|
Method Summary | |
---|---|
protected Object |
doLoad(LoadEvent event,
EntityPersister persister,
EntityKey keyToLoad,
LoadEventListener.LoadType options)
Coordinates the efforts to load a given entity. |
protected Object |
load(LoadEvent event,
EntityPersister persister,
EntityKey keyToLoad,
LoadEventListener.LoadType options)
Perfoms the load of an entity. |
protected Object |
loadFromDatasource(LoadEvent event,
EntityPersister persister,
EntityKey keyToLoad,
LoadEventListener.LoadType options)
Performs the process of loading an entity from the configured underlying datasource. |
protected Object |
loadFromSecondLevelCache(LoadEvent event,
EntityPersister persister,
LoadEventListener.LoadType options)
Attempts to load the entity from the second-level cache. |
protected Object |
loadFromSessionCache(LoadEvent event,
EntityKey keyToLoad,
LoadEventListener.LoadType options)
Attempts to locate the entity in the session-level cache. |
protected Object |
lockAndLoad(LoadEvent event,
EntityPersister persister,
EntityKey keyToLoad,
LoadEventListener.LoadType options,
SessionImplementor source)
If the class to be loaded has been configured with a cache, then lock given id in that cache and then perform the load. |
void |
onLoad(LoadEvent event,
LoadEventListener.LoadType loadType)
Handle the given load event. |
protected Object |
proxyOrLoad(LoadEvent event,
EntityPersister persister,
EntityKey keyToLoad,
LoadEventListener.LoadType options)
Based on configured options, will either return a pre-existing proxy, generate a new proxy, or perform an actual load. |
Methods inherited from class org.hibernate.event.def.AbstractLockUpgradeEventListener |
---|
upgradeLock |
Methods inherited from class org.hibernate.event.def.AbstractReassociateEventListener |
---|
reassociate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Object REMOVED_ENTITY_MARKER
public static final Object INCONSISTENT_RTN_CLASS_MARKER
public static final LockMode DEFAULT_LOCK_MODE
Constructor Detail |
---|
public DefaultLoadEventListener()
Method Detail |
---|
public void onLoad(LoadEvent event, LoadEventListener.LoadType loadType) throws HibernateException
onLoad
in interface LoadEventListener
event
- The load event to be handled.
HibernateException
protected Object load(LoadEvent event, EntityPersister persister, EntityKey keyToLoad, LoadEventListener.LoadType options)
event
- The initiating load request eventpersister
- The persister corresponding to the entity to be loadedkeyToLoad
- The key of the entity to be loadedoptions
- The defined load options
HibernateException
protected Object proxyOrLoad(LoadEvent event, EntityPersister persister, EntityKey keyToLoad, LoadEventListener.LoadType options)
event
- The initiating load request eventpersister
- The persister corresponding to the entity to be loadedkeyToLoad
- The key of the entity to be loadedoptions
- The defined load options
protected Object lockAndLoad(LoadEvent event, EntityPersister persister, EntityKey keyToLoad, LoadEventListener.LoadType options, SessionImplementor source)
event
- The initiating load request eventpersister
- The persister corresponding to the entity to be loadedkeyToLoad
- The key of the entity to be loadedoptions
- The defined load optionssource
- The originating session
HibernateException
protected Object doLoad(LoadEvent event, EntityPersister persister, EntityKey keyToLoad, LoadEventListener.LoadType options)
event
- The load eventpersister
- The persister for the entity being requested for loadkeyToLoad
- The EntityKey representing the entity to be loaded.options
- The load options.
protected Object loadFromDatasource(LoadEvent event, EntityPersister persister, EntityKey keyToLoad, LoadEventListener.LoadType options)
event
- The load eventpersister
- The persister for the entity being requested for loadkeyToLoad
- The EntityKey representing the entity to be loaded.options
- The load options.
protected Object loadFromSessionCache(LoadEvent event, EntityKey keyToLoad, LoadEventListener.LoadType options) throws HibernateException
event
- The load eventkeyToLoad
- The EntityKey representing the entity to be loaded.options
- The load options.
HibernateException
- Generally indicates problems applying a lock-mode.protected Object loadFromSecondLevelCache(LoadEvent event, EntityPersister persister, LoadEventListener.LoadType options)
event
- The load eventpersister
- The persister for the entity being requested for loadoptions
- The load options.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |