I'm writing a HQL query. Depending on conditions in my view I'm adding selects in SELECT
clause(the number of selects is from 1 to about 20). Using list()
on query hibernate will return Object array of object arrays at least I think so. If I iterate trough the result
Iterator<Object[]> itr = result.iterator();
while(itr.hasNext()){
Object[] obj = (Object[]) itr.next();
System.out.println(obj); //1st
for (int br = 0; br <= obj.length-1;br ++) {
System.out.print(obj[br].toString() + ","); //2nd
}
}
The 1st Sytsem.out prints
each Object array and the 2nd one prints their's content. For testing output to console is fine.
I try to use the results to Jasper Reports and somehow can't access the content of each Object array. Can someone give me advice or suggest an approach like converting the results to format I can use in report.