Package org.hibernate.event

Examples of org.hibernate.event.LoadEvent


    if ( log.isDebugEnabled() ) {
      EntityPersister persister = getFactory().getEntityPersister(entityName);
      log.debug( "initializing proxy: " + MessageHelper.infoString( persister, id, getFactory() ) );
    }
   
    LoadEvent event = new LoadEvent(id, entityName, true, this);
    fireLoad(event, LoadEventListener.IMMEDIATE_LOAD);
    return event.getResult();
  }
View Full Code Here


  public Object internalLoad(String entityName, Serializable id, boolean eager, boolean nullable) throws HibernateException {
    // todo : remove
    LoadEventListener.LoadType type = nullable ?
        LoadEventListener.INTERNAL_LOAD_NULLABLE :
        eager ? LoadEventListener.INTERNAL_LOAD_EAGER : LoadEventListener.INTERNAL_LOAD_LAZY;
    LoadEvent event = new LoadEvent(id, entityName, true, this);
    fireLoad(event, type);
    if ( !nullable ) {
      UnresolvableObjectException.throwIfNull( event.getResult(), id, entityName );
    }
    return event.getResult();
  }
View Full Code Here

  public Object load(Class entityClass, Serializable id, LockMode lockMode) throws HibernateException {
    return load( entityClass.getName(), id, lockMode );
  }

  public Object load(String entityName, Serializable id, LockMode lockMode) throws HibernateException {
    LoadEvent event = new LoadEvent(id, entityName, lockMode, this);
    fireLoad( event, LoadEventListener.LOAD );
    return event.getResult();
  }
View Full Code Here

  public Object get(Class entityClass, Serializable id, LockMode lockMode) throws HibernateException {
    return get( entityClass.getName(), id, lockMode );
  }

  public Object get(String entityName, Serializable id, LockMode lockMode) throws HibernateException {
    LoadEvent event = new LoadEvent(id, entityName, lockMode, this);
       fireLoad(event, LoadEventListener.GET);
    return event.getResult();
  }
View Full Code Here


  // load()/get() operations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  public void load(Object object, Serializable id) throws HibernateException {
    LoadEvent event = new LoadEvent(id, object, this);
    fireLoad( event, LoadEventListener.RELOAD );
  }
View Full Code Here

  public Object load(Class entityClass, Serializable id) throws HibernateException {
    return load( entityClass.getName(), id );
  }

  public Object load(String entityName, Serializable id) throws HibernateException {
    LoadEvent event = new LoadEvent(id, entityName, false, this);
    boolean success = false;
    try {
      fireLoad( event, LoadEventListener.LOAD );
      if ( event.getResult() == null ) {
        getFactory().getEntityNotFoundDelegate().handleEntityNotFound( entityName, id );
      }
      success = true;
      return event.getResult();
    }
    finally {
      afterOperation(success);
    }
  }
View Full Code Here

  public Object get(Class entityClass, Serializable id) throws HibernateException {
    return get( entityClass.getName(), id );
  }

  public Object get(String entityName, Serializable id) throws HibernateException {
    LoadEvent event = new LoadEvent(id, entityName, false, this);
    boolean success = false;
    try {
      fireLoad(event, LoadEventListener.GET);
      success = true;
      return event.getResult();
    }
    finally {
      afterOperation(success);
    }
  }
View Full Code Here

    if ( log.isDebugEnabled() ) {
      EntityPersister persister = getFactory().getEntityPersister(entityName);
      log.debug( "initializing proxy: " + MessageHelper.infoString( persister, id, getFactory() ) );
    }
   
    LoadEvent event = new LoadEvent(id, entityName, true, this);
    fireLoad(event, LoadEventListener.IMMEDIATE_LOAD);
    return event.getResult();
  }
View Full Code Here

  public Object internalLoad(String entityName, Serializable id, boolean eager, boolean nullable) throws HibernateException {
    // todo : remove
    LoadEventListener.LoadType type = nullable ?
        LoadEventListener.INTERNAL_LOAD_NULLABLE :
        eager ? LoadEventListener.INTERNAL_LOAD_EAGER : LoadEventListener.INTERNAL_LOAD_LAZY;
    LoadEvent event = new LoadEvent(id, entityName, true, this);
    fireLoad(event, type);
    if ( !nullable ) {
      UnresolvableObjectException.throwIfNull( event.getResult(), id, entityName );
    }
    return event.getResult();
  }
View Full Code Here

  public Object load(Class entityClass, Serializable id, LockMode lockMode) throws HibernateException {
    return load( entityClass.getName(), id, lockMode );
  }

  public Object load(String entityName, Serializable id, LockMode lockMode) throws HibernateException {
    LoadEvent event = new LoadEvent(id, entityName, lockMode, this);
    fireLoad( event, LoadEventListener.LOAD );
    return event.getResult();
  }
View Full Code Here

TOP

Related Classes of org.hibernate.event.LoadEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.