Package br.net.woodstock.rockframework.domain.persistence.orm.query

Examples of br.net.woodstock.rockframework.domain.persistence.orm.query.QueryException


      QueryContextHelper.generateQueryString(context, options);
      return context;
    } catch (QueryException exception) {
      throw exception;
    } catch (Exception exception) {
      throw new QueryException(exception);
    }
  }
View Full Code Here


        QueryContextHelper.handleCommonValue(context, sqlName, sqlAlias, value);
      }
    } catch (QueryException exception) {
      throw exception;
    } catch (Exception exception) {
      throw new QueryException(exception);
    }
  }
View Full Code Here

      QueryContextHelper.generateQueryString(context, options);
      return context;
    } catch (QueryException exception) {
      throw exception;
    } catch (Exception exception) {
      throw new QueryException(exception);
    }
  }
View Full Code Here

        QueryContextHelper.handleCommonValue(context, sqlName, sqlAlias, value);
      }
    } catch (QueryException exception) {
      throw exception;
    } catch (Exception exception) {
      throw new QueryException(exception);
    }
  }
View Full Code Here

    Map<String, Object> options = query.getOptions();

    Query q = null;

    if (query.isNamed()) {
      throw new QueryException("Hibernate dont support named queries");
    } else if (query.isNativeSQL()) {
      if ((ConditionUtils.containsKey(options, Constants.OPTION_TARGET_ENTITY))) {
        Object targetEntity = options.get(Constants.OPTION_TARGET_ENTITY);
        if (targetEntity instanceof Class) {
          SQLQuery sq = session.createSQLQuery(query.getQuery());
          sq.addEntity((Class) targetEntity);
          q = sq;
        } else if (targetEntity instanceof String) {
          try {
            SQLQuery sq = session.createSQLQuery(query.getQuery());
            sq.addEntity(Class.forName((String) targetEntity));
            q = sq;
          } catch (ClassNotFoundException e) {
            throw new QueryException(e);
          }
        } else {
          throw new QueryException("Invalid option[" + Constants.OPTION_TARGET_ENTITY + "] " + targetEntity);
        }
      } else {
        q = session.createSQLQuery(query.getQuery());
      }
    } else {
View Full Code Here

          q = entityManager.createNativeQuery(query.getQuery(), (Class) targetEntity);
        } else if (targetEntity instanceof String) {
          try {
            q = entityManager.createNativeQuery(query.getQuery(), Class.forName((String) targetEntity));
          } catch (ClassNotFoundException e) {
            throw new QueryException(e);
          }
        } else {
          throw new QueryException("Invalid option[" + Constants.OPTION_TARGET_ENTITY + "] " + targetEntity);
        }
      } else {
        q = entityManager.createNativeQuery(query.getQuery());
      }
    } else {
View Full Code Here

TOP

Related Classes of br.net.woodstock.rockframework.domain.persistence.orm.query.QueryException

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.