Examples of SqlQuery


Examples of org.hibernate.SQLQuery

  }

  public Query createNativeQuery(String sqlString) {
    //adjustFlushMode();
    try {
      SQLQuery q = getSession().createSQLQuery( sqlString );
      return new QueryImpl( q, this );
    }
    catch (HibernateException he) {
      throwPersistenceException( he );
      return null;
View Full Code Here

Examples of org.hibernate.SQLQuery

  }

  public Query createNativeQuery(String sqlString, Class resultClass) {
    //adjustFlushMode();
    try {
      SQLQuery q = getSession().createSQLQuery( sqlString );
      q.addEntity( "alias1", resultClass.getName(), LockMode.READ );
      return new QueryImpl( q, this );
    }
    catch (HibernateException he) {
      throwPersistenceException( he );
      return null;
View Full Code Here

Examples of org.hibernate.SQLQuery

  }

  public Query createNativeQuery(String sqlString, String resultSetMapping) {
    //adjustFlushMode();
    try {
      SQLQuery q = getSession().createSQLQuery( sqlString );
      q.setResultSetMapping( resultSetMapping );
      return new QueryImpl( q, this );
    }
    catch (HibernateException he) {
      throwPersistenceException( he );
      return null;
View Full Code Here

Examples of org.hibernate.SQLQuery

          );
  }

  public Query createNativeQuery(String sqlString) {
    try {
      SQLQuery q = getSession().createSQLQuery( sqlString );
      return new QueryImpl( q, this );
    }
    catch ( HibernateException he ) {
      throw convert( he );
    }
View Full Code Here

Examples of org.hibernate.SQLQuery

    }
  }

  public Query createNativeQuery(String sqlString, Class resultClass) {
    try {
      SQLQuery q = getSession().createSQLQuery( sqlString );
      q.addEntity( "alias1", resultClass.getName(), LockMode.READ );
      return new QueryImpl( q, this );
    }
    catch ( HibernateException he ) {
      throw convert( he );
    }
View Full Code Here

Examples of org.hibernate.SQLQuery

    }
  }

  public Query createNativeQuery(String sqlString, String resultSetMapping) {
    try {
      SQLQuery q = getSession().createSQLQuery( sqlString );
      q.setResultSetMapping( resultSetMapping );
      return new QueryImpl( q, this );
    }
    catch ( HibernateException he ) {
      throw convert( he );
    }
View Full Code Here

Examples of org.hibernate.SQLQuery

      // this need only exists for native SQL queries, not JPQL or Criteria queries (both of which do
      // partial auto flushing already).
      return;
    }

    final SQLQuery sqlQuery = (SQLQuery) query;
    if ( sqlQuery.getSynchronizedQuerySpaces() != null && ! sqlQuery.getSynchronizedQuerySpaces().isEmpty() ) {
      // The application defined query spaces on the Hibernate native SQLQuery which means the query will already
      // perform a partial flush according to the defined query spaces, no need to do a full flush.
      return;
    }
View Full Code Here

Examples of org.hibernate.SQLQuery

    String natSQL = new SQLStorage(this.timeFilterFrom, this.timeFilterTo,
        this.timeGrouping, IDlist).getSQL();

    Session session = Helper.getHibernateSession();

    SQLQuery query = session.createSQLQuery(natSQL);

    //needs to be there otherwise an exception is thrown
    query.addScalar("storage", StandardBasicTypes.DOUBLE);
    query.addScalar("intervall", StandardBasicTypes.STRING);

    @SuppressWarnings("rawtypes")
    List list = query.list();

    DataTable dtbl = new DataTable(StatisticsMode.getByClassName(
        this.getClass()).getTitle() + " "
        + Helper.getTranslation("_inGB"));
View Full Code Here

Examples of org.hibernate.SQLQuery

      String stepName = step.getTitle();
      headerRow.setName("header - delete again");
      headerRow.addValue(stepName, Double.parseDouble("0"));
    }

    SQLQuery query = session.createSQLQuery(natSQL);

    // needs to be there otherwise an exception is thrown
    query.addScalar("stepCount", StandardBasicTypes.DOUBLE);
    query.addScalar("stepName", StandardBasicTypes.STRING);
    query.addScalar("intervall", StandardBasicTypes.STRING);

    @SuppressWarnings("rawtypes")
    List list = query.list();

    DataTable dtbl = new DataTable("");

    // if headerRow is set then add it to the DataTable to set columns
    // needs to be removed later
View Full Code Here

Examples of org.hibernate.SQLQuery

        getTimeUnit(), IDlist).getSQL(HistoryEventType.stepError, null,
        false, false);

    Session session = Helper.getHibernateSession();

    SQLQuery query = session.createSQLQuery(natSQL);

    //needs to be there otherwise an exception is thrown
    query.addScalar("stepCount", StandardBasicTypes.DOUBLE);
    query.addScalar("intervall", StandardBasicTypes.STRING);

    @SuppressWarnings("rawtypes")
    List list = query.list();

    DataTable dtbl = new DataTable(StatisticsMode.getByClassName(
        this.getClass()).getTitle()
        + Helper.getTranslation("_(number)"));
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.