Package javax.persistence

Examples of javax.persistence.EntityNotFoundException


      QueryTimeoutException converted = new QueryTimeoutException(e.getMessage(), e);
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof ObjectNotFoundException ) {
      EntityNotFoundException converted = new EntityNotFoundException( e.getMessage() );
      handlePersistenceException( converted );
      return converted;
    }
        else if ( e instanceof org.hibernate.NonUniqueObjectException ) {
            EntityExistsException converted = new EntityExistsException( e.getMessage() );
            handlePersistenceException( converted );
            return converted;
        }
    else if ( e instanceof org.hibernate.NonUniqueResultException ) {
      NonUniqueResultException converted = new NonUniqueResultException( e.getMessage() );
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof UnresolvableObjectException ) {
      EntityNotFoundException converted = new EntityNotFoundException( e.getMessage() );
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof QueryException ) {
      return new IllegalArgumentException( e );
View Full Code Here


      QueryTimeoutException converted = new QueryTimeoutException(e.getMessage(), e);
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof ObjectNotFoundException ) {
      EntityNotFoundException converted = new EntityNotFoundException( e.getMessage() );
      handlePersistenceException( converted );
      return converted;
    }
        else if ( e instanceof org.hibernate.NonUniqueObjectException ) {
            EntityExistsException converted = new EntityExistsException( e.getMessage() );
            handlePersistenceException( converted );
            return converted;
        }
    else if ( e instanceof org.hibernate.NonUniqueResultException ) {
      NonUniqueResultException converted = new NonUniqueResultException( e.getMessage() );
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof UnresolvableObjectException ) {
      EntityNotFoundException converted = new EntityNotFoundException( e.getMessage() );
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof QueryException ) {
      return new IllegalArgumentException( e );
View Full Code Here

 
  private ClassLoader providedClassLoader;

  private static class JpaEntityNotFoundDelegate implements EntityNotFoundDelegate, Serializable {
    public void handleEntityNotFound(String entityName, Serializable id) {
      throw new EntityNotFoundException( "Unable to find " + entityName  + " with id " + id );
    }
View Full Code Here

      QueryTimeoutException converted = new QueryTimeoutException(e.getMessage(), e);
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof ObjectNotFoundException ) {
      EntityNotFoundException converted = new EntityNotFoundException( e.getMessage() );
      handlePersistenceException( converted );
      return converted;
    }
        else if ( e instanceof org.hibernate.NonUniqueObjectException ) {
            EntityExistsException converted = new EntityExistsException( e.getMessage() );
            handlePersistenceException( converted );
            return converted;
        }
    else if ( e instanceof org.hibernate.NonUniqueResultException ) {
      NonUniqueResultException converted = new NonUniqueResultException( e.getMessage() );
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof UnresolvableObjectException ) {
      EntityNotFoundException converted = new EntityNotFoundException( e.getMessage() );
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof QueryException ) {
      return new IllegalArgumentException( e );
View Full Code Here

          e.getMessage(), e
      );
      throwPersistenceException( converted );
    }
    else if ( e instanceof ObjectNotFoundException ) {
      throwPersistenceException( new EntityNotFoundException( e.getMessage() ) );
    }
    else if ( e instanceof org.hibernate.NonUniqueResultException ) {
      throwPersistenceException( new NonUniqueResultException( e.getMessage() ) );
    }
    else if ( e instanceof UnresolvableObjectException ) {
      throwPersistenceException( new EntityNotFoundException( e.getMessage() ) );
    }
    else if ( e instanceof QueryException ) {
      throw new IllegalArgumentException( e );
    }
    else if ( e instanceof TransientObjectException ) {
View Full Code Here

      PersistenceException converted = wrapLockException(e, lockOptions);
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof ObjectNotFoundException ) {
      EntityNotFoundException converted = new EntityNotFoundException( e.getMessage() );
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof org.hibernate.NonUniqueResultException ) {
      NonUniqueResultException converted = new NonUniqueResultException( e.getMessage() );
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof UnresolvableObjectException ) {
      EntityNotFoundException converted = new EntityNotFoundException( e.getMessage() );
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof QueryException ) {
      return new IllegalArgumentException( e );
View Full Code Here

  private static EntityNotFoundDelegate ejb3EntityNotFoundDelegate = new Ejb3EntityNotFoundDelegate();
  private static Configuration DEFAULT_CONFIGURATION = new Configuration();

  private static class Ejb3EntityNotFoundDelegate implements EntityNotFoundDelegate, Serializable {
    public void handleEntityNotFound(String entityName, Serializable id) {
      throw new EntityNotFoundException("Unable to find " + entityName  + " with id " + id);
    }
View Full Code Here

   * @see org.cipres.treebase.domain.admin.UserService#deleteUser(java.lang.String)
   */
  public void deleteUser(String pUserName) {
    User user = findUserByName(pUserName);
    if (user == null) {
      throw new EntityNotFoundException("Delete User: cannot find user " + pUserName);
    } else {
      getUserHome().delete(user);
    }
  }
View Full Code Here

    else if ( e instanceof ConstraintViolationException ) {
      //FIXME this is bad cause ConstraintViolationException happens in other circumstances
      throwPersistenceException( new EntityExistsException( e ) );
    }
    else if ( e instanceof ObjectNotFoundException ) {
      throwPersistenceException( new EntityNotFoundException( e.getMessage() ) );
    }
    else if ( e instanceof org.hibernate.NonUniqueResultException ) {
      throwPersistenceException( new NonUniqueResultException( e.getMessage() ) );
    }
    else if ( e instanceof UnresolvableObjectException ) {
      throwPersistenceException( new EntityNotFoundException( e.getMessage() ) );
    }
    else if ( e instanceof QueryException ) {
      throw new IllegalArgumentException( e );
    }
    else if ( e instanceof TransientObjectException ) {
View Full Code Here

      QueryTimeoutException converted = new QueryTimeoutException(e.getMessage(), e);
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof ObjectNotFoundException ) {
      EntityNotFoundException converted = new EntityNotFoundException( e.getMessage() );
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof org.hibernate.NonUniqueResultException ) {
      NonUniqueResultException converted = new NonUniqueResultException( e.getMessage() );
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof UnresolvableObjectException ) {
      EntityNotFoundException converted = new EntityNotFoundException( e.getMessage() );
      handlePersistenceException( converted );
      return converted;
    }
    else if ( e instanceof QueryException ) {
      return new IllegalArgumentException( e );
View Full Code Here

TOP

Related Classes of javax.persistence.EntityNotFoundException

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.