public class DefaultLoadEventListener extends AbstractLockUpgradeEventListener implements LoadEventListener
LoadEventListener.LoadType| Modifier and Type | Field and Description |
|---|---|
static LockMode |
DEFAULT_LOCK_MODE |
static java.lang.Object |
INCONSISTENT_RTN_CLASS_MARKER |
static java.lang.Object |
REMOVED_ENTITY_MARKER |
GET, IMMEDIATE_LOAD, INTERNAL_LOAD_EAGER, INTERNAL_LOAD_LAZY, INTERNAL_LOAD_NULLABLE, LOAD, RELOAD| Constructor and Description |
|---|
DefaultLoadEventListener() |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
doLoad(LoadEvent event,
EntityPersister persister,
EntityKey keyToLoad,
LoadEventListener.LoadType options)
Coordinates the efforts to load a given entity.
|
protected java.lang.Object |
load(LoadEvent event,
EntityPersister persister,
EntityKey keyToLoad,
LoadEventListener.LoadType options)
Perfoms the load of an entity.
|
protected java.lang.Object |
loadFromDatasource(LoadEvent event,
EntityPersister persister,
EntityKey keyToLoad,
LoadEventListener.LoadType options)
Performs the process of loading an entity from the configured
underlying datasource.
|
protected java.lang.Object |
loadFromSecondLevelCache(LoadEvent event,
EntityPersister persister,
LoadEventListener.LoadType options)
Attempts to load the entity from the second-level cache.
|
protected java.lang.Object |
loadFromSessionCache(LoadEvent event,
EntityKey keyToLoad,
LoadEventListener.LoadType options)
Attempts to locate the entity in the session-level cache.
|
protected java.lang.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 java.lang.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.
|
upgradeLockreassociatepublic static final java.lang.Object REMOVED_ENTITY_MARKER
public static final java.lang.Object INCONSISTENT_RTN_CLASS_MARKER
public static final LockMode DEFAULT_LOCK_MODE
public void onLoad(LoadEvent event, LoadEventListener.LoadType loadType) throws HibernateException
onLoad in interface LoadEventListenerevent - The load event to be handled.HibernateExceptionprotected java.lang.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 optionsHibernateExceptionprotected java.lang.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 optionsprotected java.lang.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 sessionHibernateExceptionprotected java.lang.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 java.lang.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 java.lang.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 java.lang.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.Copyright © 2013. All Rights Reserved.