Examples of AssetManagerRuntimeException


Examples of org.pau.assetmanager.utils.AssetManagerRuntimeException

           ) {
        Query query = entityManager.createQuery(queryString);
        if (argument.length % 2 != 0) {
          String message = "The arguments for the query should be a list of <String, Object> pairs";
          logger.error(message);
          throw new AssetManagerRuntimeException(message);
        }
        for (int index = 0; index < argument.length; index = index + 2) {
          String label = (String) argument[index];
          Object value = argument[index + 1];
          query.setParameter(label, value);
View Full Code Here

Examples of org.pau.assetmanager.utils.AssetManagerRuntimeException

      protected Optional<T> doInTransaction(EntityManager entityManager, String queryString
           ) {
        Query query = entityManager.createQuery(queryString);
        if (argument.length % 2 != 0) {
          String message = "The arguments for the query should be a list of <String, Object> pairs";
          throw new AssetManagerRuntimeException(message);
        }
        for (int index = 0; index < argument.length; index = index + 2) {
          String label = (String) argument[index];
          Object value = argument[index + 1];
          query.setParameter(label, value);
        }
        try {
          T result = (T) query.getSingleResult();
          return Optional.of(result);
        } catch (NoResultException e) {
          logger.info("No result found searching a unique element", e);
          return Optional.absent();
        } catch(NonUniqueResultException nonUniqueResultException){
          logger.error("Non unique result found searching a unique element", nonUniqueResultException);
          throw new AssetManagerRuntimeException("Returned more that one element in the query", nonUniqueResultException);
        }
      }

    };
  }
View Full Code Here

Examples of org.pau.assetmanager.utils.AssetManagerRuntimeException

          EntityManager entityManager,String queryString
           ) {
        Query query = entityManager.createNativeQuery(queryString);
        if (arguments.length % 2 != 0) {
          String message = "The arguments for the query should be a list of <String, Object> pairs";
          throw new AssetManagerRuntimeException(message);
        }
        for (int index = 0; index < arguments.length; index = index + 2) {
          String label = (String) arguments[index];
          Object value = arguments[index + 1];
          query.setParameter(label, value);
View Full Code Here

Examples of org.pau.assetmanager.utils.AssetManagerRuntimeException

          EntityManager entityManager,String queryString
           ) {
        Query query = entityManager.createNativeQuery(queryString);
        if (arguments.length % 2 != 0) {
          String message = "The arguments for the query should be a list of <String, Object> pairs";
          throw new AssetManagerRuntimeException(message);
        }
        for (int index = 0; index < arguments.length; index = index + 2) {
          String label = (String) arguments[index];
          Object value = arguments[index + 1];
          query.setParameter(label, value);
View Full Code Here

Examples of org.pau.assetmanager.utils.AssetManagerRuntimeException

      return propertyBook;
    }
    String message = "The PropertyExpensesAnnotation '" + this.toString()
        + "' has a Book which is not a PropertyBook.";
    logger.error(message);
    throw new AssetManagerRuntimeException(message);
  }
View Full Code Here

Examples of org.pau.assetmanager.utils.AssetManagerRuntimeException

      return propertyBook;
    }
    String message = "The PropertyIncomeAnnotation '"
        + this.toString() + "' has a Book which is not a PropertyBook.";
    logger.error(message);
    throw new AssetManagerRuntimeException(message);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.