object = session.getEntityUsingInterceptor( key ); if ( object != null ) {
object = session.getEntityUsingInterceptor( key ); if ( object != null ) {
/** * Attempts to locate the entity in the session-level cache. 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. * * @return The entity from the session-level cache, or null. * @throws HibernateException */ protected Object loadFromSessionCache( final LoadEvent event, final EntityKey keyToLoad, final LoadEventListener.LoadType options) throws HibernateException { SessionImplementor session = event.getSession(); Object old = session.getEntityUsingInterceptor(keyToLoad); if ( old != null ) { // this object was already loaded EntityEntry oldEntry = session.getPersistenceContext().getEntry(old); if ( options.isCheckDeleted() ) { throwObjectDeletedIfNecessary( event, oldEntry ); } upgradeLock( old, oldEntry, event.getLockMode(), session ); } return old; }
Object old = session.getEntityUsingInterceptor( keyToLoad );