Hibernate version: 2.1.7
Name and version of the database you are using: MySQL 4.0.18
Hello,
i'm looking for a way to get the result of a reporting query as
an associative array.
Example in Pseudocode:
Code:
// a, b, c - properties of objects - not entities
Query q = hibernateSession.createQuery("SELECT a,b,c FROM x JOIN Y");
List results = q.list();
...
while (moreResults) {
result = (Object[]) it.next();
String a = (String) result[0];
Integer b = (Integer) result[1];
...
}
This way code is likely to get errorprone. Is there a way to get as result
a Map - so that the result can be accessed as an associative array?
Code:
// nicer would be something like
String a = result.getString("a);
Integer b = result.getInteger("b");
Any ideas?
Thanks,
Stefan.