Package org.hibernate

Examples of org.hibernate.SQLQuery.addScalar()


    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);
    query.addScalar("intervall", StandardBasicTypes.STRING);

    @SuppressWarnings("rawtypes")
    List list = query.list();
View Full Code Here


    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);
    query.addScalar("intervall", StandardBasicTypes.STRING);

    @SuppressWarnings("rawtypes")
    List list = query.list();
View Full Code Here

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

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

    DataTable dtbl = new DataTable("");
View Full Code Here

    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")
    List list = query.list();

    if (list != null && list.size() > 0 && list.get(0) != null) {
View Full Code Here

    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")
    List list = query.list();

    if (list != null && list.size() > 0 && list.get(0) != null) {
View Full Code Here

    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);

    @SuppressWarnings("rawtypes")
    List list = query.list();
View Full Code Here

    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);

    @SuppressWarnings("rawtypes")
    List list = query.list();
View Full Code Here

    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);

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

    StringBuilder title = new StringBuilder(StatisticsMode.PRODUCTION.getTitle());
View Full Code Here

    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

        .addProperty( "element.employmentId", "empId" )
        .addProperty( "element.salary" ).addColumnAlias( "VALUE" ).addColumnAlias( "CURRENCY" );
    sqlQuery.list();

    // lets try a totally different approach now and pull back scalars, first with explicit types
    sqlQuery.addScalar( "orgid", LongType.INSTANCE )
        .addScalar( "name", StringType.INSTANCE )
        .addScalar( "empid", LongType.INSTANCE )
        .addScalar( "employee", LongType.INSTANCE )
        .addScalar( "startDate", TimestampType.INSTANCE )
        .addScalar( "endDate", TimestampType.INSTANCE )
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.