Package org.hibernate.engine

Examples of org.hibernate.engine.Status


    final int size = list.length;
    final Object anything = getAnything();
    for ( int i=0; i<size; i++ ) {
      Map.Entry me = list[i];
      EntityEntry entry = (EntityEntry) me.getValue();
      Status status = entry.getStatus();
      if ( status == Status.MANAGED || status == Status.SAVING ) {
        cascadeOnFlush( session, entry.getPersister(), me.getKey(), anything );
      }
    }
  }
View Full Code Here


      // Update the status of the object and if necessary, schedule an update

      Map.Entry me = list[i];
      EntityEntry entry = (EntityEntry) me.getValue();
      Status status = entry.getStatus();

      if ( status != Status.LOADING && status != Status.GONE ) {
        FlushEntityEvent entityEvent = new FlushEntityEvent( source, me.getKey(), entry );
        FlushEntityEventListener[] listeners = source.getListeners().getFlushEntityEventListeners();
        for ( int j = 0; j < listeners.length; j++ ) {
View Full Code Here

  public void onFlushEntity(FlushEntityEvent event) throws HibernateException {
    final Object entity = event.getEntity();
    final EntityEntry entry = event.getEntityEntry();
    final EventSource session = event.getSession();
    final EntityPersister persister = entry.getPersister();
    final Status status = entry.getStatus();
    final EntityMode entityMode = session.getEntityMode();
    final Type[] types = persister.getPropertyTypes();

    final boolean mightBeDirty = entry.requiresDirtyCheck(entity);
View Full Code Here

      EntityMode entityMode,
      boolean mightBeDirty,
          SessionImplementor session
  ) {
    final Object[] loadedState = entry.getLoadedState();
    final Status status = entry.getStatus();
    final EntityPersister persister = entry.getPersister();

    final Object[] values;
    if ( status == Status.DELETED ) {
      //grab its state saved at deletion
View Full Code Here

      return false;
    }
  }

  private boolean isUpdateNecessary(final FlushEntityEvent event, final boolean mightBeDirty) {
    final Status status = event.getEntityEntry().getStatus();
    if ( mightBeDirty || status==Status.DELETED ) {
      // compare to cached state (ignoring collections unless versioned)
      dirtyCheck(event);
      if ( isUpdateNecessary(event) ) {
        return true;
View Full Code Here

  private boolean scheduleUpdate(final FlushEntityEvent event) {
   
    final EntityEntry entry = event.getEntityEntry();
    final EventSource session = event.getSession();
    final Object entity = event.getEntity();
    final Status status = entry.getStatus();
    final EntityMode entityMode = session.getEntityMode();
    final EntityPersister persister = entry.getPersister();
    final Object[] values = event.getPropertyValues();
   
    if ( log.isTraceEnabled() ) {
View Full Code Here

   * Note: this method is quite slow, avoid calling if possible!
   */
  protected final boolean isUpdateNecessary(FlushEntityEvent event) throws HibernateException {

    EntityPersister persister = event.getEntityEntry().getPersister();
    Status status = event.getEntityEntry().getStatus();
   
    if ( !event.isDirtyCheckPossible() ) {
      return true;
    }
    else {
View Full Code Here

    if ( existing != null ) {
      // return existing object or initialized proxy (unless deleted)
      log.trace( "entity found in session cache" );
      if ( options.isCheckDeleted() ) {
        EntityEntry entry = persistenceContext.getEntry( existing );
        Status status = entry.getStatus();
        if ( status == Status.DELETED || status == Status.GONE ) {
          return null;
        }
      }
      return existing;
View Full Code Here

    if ( old != null ) {
      // this object was already loaded
      EntityEntry oldEntry = session.getPersistenceContext().getEntry( old );
      if ( options.isCheckDeleted() ) {
        Status status = oldEntry.getStatus();
        if ( status == Status.DELETED || status == Status.GONE ) {
          return REMOVED_ENTITY_MARKER;
        }
      }
      if ( options.isAllowNulls() ) {
View Full Code Here

    if ( existing != null ) {
      // return existing object or initialized proxy (unless deleted)
      log.trace( "entity found in session cache" );
      if ( options.isCheckDeleted() ) {
        EntityEntry entry = persistenceContext.getEntry( existing );
        Status status = entry.getStatus();
        if ( status == Status.DELETED || status == Status.GONE ) {
          return null;
        }
      }
      return existing;
View Full Code Here

TOP

Related Classes of org.hibernate.engine.Status

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.