// 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);
headerQuery.addScalar("intervall", StandardBasicTypes.STRING);
@SuppressWarnings("rawtypes")
List headerList = headerQuery.list();
for (Object obj : headerList) {
Object[] objArr = (Object[]) obj;
try {
headerRow.setName(new Converter(objArr[3]).getString() + "");
headerRow.addValue(new Converter(new Converter(objArr[2]).getInteger()).getString() + " (" + new Converter(objArr[1]).getString()
+ ")", (new Converter(objArr[0]).getDouble()));
} catch (Exception e) {
headerRow.addValue(e.getMessage(), new Double(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("stepOrder", StandardBasicTypes.DOUBLE);
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