Package br.gov.frameworkdemoiselle.internal.configuration

Examples of br.gov.frameworkdemoiselle.internal.configuration.EntityManagerConfig


  public String toString() {
    return getEntityManagerDelegate().toString();
  }
 
  private void checkEntityManagerScopePassivable(Object entity)  {
    EntityManagerConfig configuration = getConfiguration();
    if (configuration.getEntityManagerScope()==EntityManagerScope.CONVERSATION
        || configuration.getEntityManagerScope()==EntityManagerScope.SESSION
        || configuration.getEntityManagerScope()==EntityManagerScope.VIEW){
   
      LockModeType lockMode = null;
      if (getEntityManagerDelegate().contains(entity)){
        lockMode = getEntityManagerDelegate().getLockMode(entity);
      }
View Full Code Here


      checkEntityManagerScopePassivable(lockMode);
    }
  }

  private void checkEntityManagerScopePassivable(LockModeType lockMode)  {
    EntityManagerConfig configuration = getConfiguration();
    if (configuration.getEntityManagerScope()==EntityManagerScope.CONVERSATION
        || configuration.getEntityManagerScope()==EntityManagerScope.SESSION
        || configuration.getEntityManagerScope()==EntityManagerScope.VIEW){
     
      if (lockMode!=null
          && lockMode!=LockModeType.NONE
          && lockMode!=LockModeType.OPTIMISTIC_FORCE_INCREMENT){
        String message = getBundle().getString("passivable-scope-without-optimistic-lock" , configuration.getEntityManagerScope().toString());
        getLogger().error(message);
        throw new DemoiselleException(message);
      }
    }
  }
View Full Code Here

  public String toString() {
    return getEntityManagerDelegate().toString();
  }
 
  private void checkEntityManagerScopePassivable(Object entity)  {
    EntityManagerConfig configuration = getConfiguration();
    if (configuration.getEntityManagerScope()==EntityManagerScope.CONVERSATION
        || configuration.getEntityManagerScope()==EntityManagerScope.SESSION
        || configuration.getEntityManagerScope()==EntityManagerScope.VIEW){
   
      LockModeType lockMode = null;
      if (getEntityManagerDelegate().contains(entity)){
        lockMode = getEntityManagerDelegate().getLockMode(entity);
      }
View Full Code Here

      checkEntityManagerScopePassivable(lockMode);
    }
  }

  private void checkEntityManagerScopePassivable(LockModeType lockMode)  {
    EntityManagerConfig configuration = getConfiguration();
    if (configuration.getEntityManagerScope()==EntityManagerScope.CONVERSATION
        || configuration.getEntityManagerScope()==EntityManagerScope.SESSION
        || configuration.getEntityManagerScope()==EntityManagerScope.VIEW){
     
      if (lockMode!=null
          && lockMode!=LockModeType.NONE
          && lockMode!=LockModeType.OPTIMISTIC_FORCE_INCREMENT){
        String message = getBundle().getString("passivable-scope-without-optimistic-lock" , configuration.getEntityManagerScope().toString());
        getLogger().error(message);
        throw new DemoiselleException(message);
      }
    }
  }
View Full Code Here

  void close() {
    //Se o produtor não possui escopo, então o ciclo de vida
    //de EntityManager produzidos é responsabilidade do desenvolvedor. Não
    //fechamos os EntityManagers aqui.
    EntityManagerConfig configuration = getConfiguration();
    if (configuration.getEntityManagerScope() != EntityManagerScope.NOSCOPE){
      for (EntityManager entityManager : cache.values()) {
        entityManager.close();
      }
    }
    cache.clear();
View Full Code Here

TOP

Related Classes of br.gov.frameworkdemoiselle.internal.configuration.EntityManagerConfig

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.