Examples of createSQLQuery()


Examples of org.hibernate.Session.createSQLQuery()

        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);
View Full Code Here

Examples of org.hibernate.Session.createSQLQuery()

    // creating header row from headerSQL (gets all columns in one row
    DataRow headerRow = null;
    if (headerFromSQL != null) {
      headerRow = new DataRow(null);
      SQLQuery headerQuery = session.createSQLQuery(headerFromSQL);

      // needs to be there otherwise an exception is thrown
      headerQuery.addScalar("stepCount", StandardBasicTypes.DOUBLE);
      headerQuery.addScalar("stepName", StandardBasicTypes.STRING);
      headerQuery.addScalar("stepOrder", StandardBasicTypes.DOUBLE);
View Full Code Here

Examples of org.hibernate.Session.createSQLQuery()

        }
      }

    }

    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("stepOrder", StandardBasicTypes.DOUBLE);
View Full Code Here

Examples of org.hibernate.Session.createSQLQuery()

    // adding time restrictions
    String natSQL = new SQLStepRequestsImprovedDiscrimination(this.timeFilterFrom, this.timeFilterTo, this.timeGrouping, this.myIDlist)
        .SQLMaxStepOrder(requestedType);

    Session session = Helper.getHibernateSession();
    SQLQuery query = session.createSQLQuery(natSQL);

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

    @SuppressWarnings("rawtypes")
View Full Code Here

Examples of org.hibernate.Session.createSQLQuery()

    // adding time restrictions
    String natSQL = new SQLStepRequestsImprovedDiscrimination(this.timeFilterFrom, this.timeFilterTo, this.timeGrouping, this.myIDlist)
        .SQLMinStepOrder(requestedType);

    Session session = Helper.getHibernateSession();
    SQLQuery query = session.createSQLQuery(natSQL);

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

    @SuppressWarnings("rawtypes")
View Full Code Here

Examples of org.hibernate.Session.createSQLQuery()

    } else {
      natSQL = new ImprovedSQLProduction(this.timeFilterFrom, this.timeFilterTo, this.timeGrouping, IDlist).getSQL(stepname);
    }
    Session session = Helper.getHibernateSession();

    SQLQuery query = session.createSQLQuery(natSQL);

    // needs to be there otherwise an exception is thrown
    query.addScalar("volumes", StandardBasicTypes.INTEGER);
    query.addScalar("pages", StandardBasicTypes.INTEGER);
    query.addScalar("intervall", StandardBasicTypes.STRING);
View Full Code Here

Examples of org.hibernate.Session.createSQLQuery()

    Session session = sessionFactory.openSession();
    try {
      for (String query : cleanSql) {
        // log.trace(query);
        session.createSQLQuery(query).executeUpdate();
      }
    } finally {
      session.close();
    }
  }
View Full Code Here

Examples of org.hibernate.Session.createSQLQuery()

    String recordsLeftMsg = "";
    Session session = sessionFactory.openSession();
    try {
      for (String tableName : tableNames) {
        String countSql = "select count(*) as RECORD_COUNT_ from "+tableName;
        SQLQuery sqlQuery = session.createSQLQuery(countSql);
        sqlQuery.addScalar("RECORD_COUNT_", Hibernate.LONG);
        Long recordCount = (Long) sqlQuery.uniqueResult();
        if (recordCount>0L) {
          recordsLeftMsg += tableName+":"+recordCount+", ";
        }
View Full Code Here

Examples of org.hibernate.Session.createSQLQuery()

    }


    public TipoDeficiencia pesquisarTipoDeficienciaPorCodigo(int cod){
        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {tipo_deficiencia.*} FROM tipo_deficiencia {tipo_deficiencia} WHERE cod_tipo_deficiencia = "+cod);

        query.addEntity("tipo_deficiencia", TipoDeficiencia.class);

        TipoDeficiencia df = null;
        if(query.list().size() > 0){
View Full Code Here

Examples of org.hibernate.Session.createSQLQuery()

        return df;
    }

    public TipoDeficiencia pesquisarTipoDeficienciaPorDescricao(String desc){
        Session session = factory.openSession();
        SQLQuery query = session.createSQLQuery("SELECT {tipo_deficiencia.*} FROM tipo_deficiencia {tipo_deficiencia} WHERE descricao like '"+desc+"'");

        query.addEntity("tipo_deficiencia", TipoDeficiencia.class);

        TipoDeficiencia df = null;
        if(query.list().size() > 0){
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.