Package org.hibernate

Examples of org.hibernate.ObjectDeletedException


            break;
          case PERSISTENT:
            entityIsPersistent( event, copyCache );
            break;
          default: //DELETED
            throw new ObjectDeletedException(
                "deleted instance passed to merge",
                null,
                getLoggableName( event.getEntityName(), entity )
            );
        }
View Full Code Here


        event.getSession().getActionQueue().unScheduleDeletion( entityEntry, event.getObject() );
        entityIsDeleted( event, createCache );
        break;
      }
      default: {
        throw new ObjectDeletedException(
            "deleted entity passed to persist",
            null,
            getLoggableName( event.getEntityName(), entity )
        );
      }
View Full Code Here

    EntityEntry e = persistenceContext.getEntry(object);
    if ( e == null ) {
      throw new TransientObjectException( "Given object not associated with the session" );
    }
    if ( e.getStatus() != Status.MANAGED ) {
      throw new ObjectDeletedException(
          "The given object was deleted",
          e.getId(),
          e.getPersister().getEntityName()
        );
    }
View Full Code Here

      LOG.debugf( "Flushing to force deletion of re-saved object: %s",
          MessageHelper.infoString( entityEntry.getPersister(), entityEntry.getId(), getFactory() ) );
    }

    if ( persistenceContext.getCascadeLevel() > 0 ) {
      throw new ObjectDeletedException(
        "deleted object would be re-saved by cascade (remove deleted object from associations)",
        entityEntry.getId(),
        entityEntry.getPersister().getEntityName()
      );
    }
View Full Code Here

    if ( requestedLockMode.greaterThan( entry.getLockMode() ) ) {
      // The user requested a "greater" (i.e. more restrictive) form of
      // pessimistic lock

      if ( entry.getStatus() != Status.MANAGED ) {
        throw new ObjectDeletedException(
            "attempted to lock a deleted instance",
            entry.getId(),
            entry.getPersister().getEntityName()
        );
      }
View Full Code Here

            break;
          case PERSISTENT:
            entityIsPersistent(event, copyCache);
            break;
          default: //DELETED
            throw new ObjectDeletedException(
                "deleted instance passed to merge",
                null,
                getLoggableName( event.getEntityName(), entity )
              );     
        }
View Full Code Here

        break;
      case TRANSIENT:
        entityIsTransient(event, createCache);
        break;
      default:
        throw new ObjectDeletedException(
            "deleted entity passed to persist",
            null,
            getLoggableName( event.getEntityName(), entity )
          );
    }
View Full Code Here

            break;
          case PERSISTENT:
            entityIsPersistent(event, copyCache);
            break;
          default: //DELETED
            throw new ObjectDeletedException(
                "deleted instance passed to merge",
                null,
                getLoggableName( event.getEntityName(), entity )
              );     
        }
View Full Code Here

    if ( requestedLockMode.greaterThan( entry.getLockMode() ) ) {
      // The user requested a "greater" (i.e. more restrictive) form of
      // pessimistic lock

      if ( entry.getStatus() != Status.MANAGED ) {
        throw new ObjectDeletedException(
            "attempted to lock a deleted instance",
            entry.getId(),
            entry.getPersister().getEntityName()
        );
      }
View Full Code Here

    // this implementation is supposed to tolerate incorrect unsaved-value
    // mappings, for the purpose of backward-compatibility
    EntityEntry entry = event.getSession().getPersistenceContext().getEntry( event.getEntity() );
    if ( entry!=null ) {
      if ( entry.getStatus()==Status.DELETED ) {
        throw new ObjectDeletedException( "deleted instance passed to update()", null, event.getEntityName() );
      }
      else {
        return entityIsPersistent(event);
      }
    }
View Full Code Here

TOP

Related Classes of org.hibernate.ObjectDeletedException

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.