Save This Page
Home » Hibernate-3.3.2.GA » org.hibernate » event » def » [javadoc | source]
org.hibernate.event.def
public class: DefaultLoadEventListener [javadoc | source]
java.lang.Object
   org.hibernate.event.def.AbstractReassociateEventListener
      org.hibernate.event.def.AbstractLockUpgradeEventListener
         org.hibernate.event.def.DefaultLoadEventListener

All Implemented Interfaces:
    LoadEventListener, Serializable

Defines the default load event listeners used by hibernate for loading entities in response to generated load events.
Field Summary
public static final  Object REMOVED_ENTITY_MARKER     
public static final  Object INCONSISTENT_RTN_CLASS_MARKER     
public static final  LockMode DEFAULT_LOCK_MODE     
Method from org.hibernate.event.def.DefaultLoadEventListener Summary:
doLoad,   load,   loadFromDatasource,   loadFromSecondLevelCache,   loadFromSessionCache,   lockAndLoad,   onLoad,   proxyOrLoad
Methods from org.hibernate.event.def.AbstractLockUpgradeEventListener:
upgradeLock
Methods from org.hibernate.event.def.AbstractReassociateEventListener:
reassociate
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.hibernate.event.def.DefaultLoadEventListener Detail:
 protected Object doLoad(LoadEvent event,
    EntityPersister persister,
    EntityKey keyToLoad,
    LoadType options) 
    Coordinates the efforts to load a given entity. First, an attempt is made to load the entity from the session-level cache. If not found there, an attempt is made to locate it in second-level cache. Lastly, an attempt is made to load it directly from the datasource.
 protected Object load(LoadEvent event,
    EntityPersister persister,
    EntityKey keyToLoad,
    LoadType options) 
    Perfoms the load of an entity.
 protected Object loadFromDatasource(LoadEvent event,
    EntityPersister persister,
    EntityKey keyToLoad,
    LoadType options) 
    Performs the process of loading an entity from the configured underlying datasource.
 protected Object loadFromSecondLevelCache(LoadEvent event,
    EntityPersister persister,
    LoadType options) 
    Attempts to load the entity from the second-level cache.
 protected Object loadFromSessionCache(LoadEvent event,
    EntityKey keyToLoad,
    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.

 protected Object lockAndLoad(LoadEvent event,
    EntityPersister persister,
    EntityKey keyToLoad,
    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.
 public  void onLoad(LoadEvent event,
    LoadType loadType) throws HibernateException 
    Handle the given load event.
 protected Object proxyOrLoad(LoadEvent event,
    EntityPersister persister,
    EntityKey keyToLoad,
    LoadType options) 
    Based on configured options, will either return a pre-existing proxy, generate a new proxy, or perform an actual load.