Package com.im.imjutil.exception

Examples of com.im.imjutil.exception.PersistenceException


        factory = Persistence.createEntityManagerFactory(
            PERSISTENCE_UNIT);
      }
     
      if (factory == null) {
        throw new PersistenceException(Convert.toString(
            "A EntityManagerFactory para a unidade de persistencia",
            " '", PERSISTENCE_UNIT, "' e nula."));
      }
     
    } catch (Exception e) {
      throw new PersistenceException(Convert.toString(
          "Erro ao obter unidade de persistencia JPA: ",
          PERSISTENCE_UNIT), e);
    }
  }
View Full Code Here


  private EntityTransaction transaction;
 
  public JPATransactionAdapter(EntityTransaction transaction)
      throws PersistenceException {
    if (transaction == null)
      throw new PersistenceException("EntityTransaction is null");
   
    this.transaction = transaction;
  }
View Full Code Here

  @Override
  public void begin() throws PersistenceException {
    try {
      transaction.begin();
    } catch (Exception e) {
      throw new PersistenceException(e.getMessage(), e);
    }
  }
View Full Code Here

  @Override
  public void commit() throws PersistenceException {
    try {
      transaction.commit();
    } catch (Exception e) {
      throw new PersistenceException(e.getMessage(), e);
    }
  }
View Full Code Here

  @Override
  public void rollback() throws PersistenceException {
    try {
      transaction.rollback();
    } catch (Exception e) {
      throw new PersistenceException(e.getMessage(), e);
    }
  }
View Full Code Here

  @Override
  public boolean isActive() throws PersistenceException {
    try {
      return transaction.isActive();
    } catch (Exception e) {
      throw new PersistenceException(e.getMessage(), e);
    }
  }
View Full Code Here

TOP

Related Classes of com.im.imjutil.exception.PersistenceException

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.