Hi,
Is it possible to get back the attribute names in a query result
<query name="Cat,name" >
select cat.name, cat.weight from Cat as cat
where cat.weight > :weight
</query>
Code:
Query query = getQuery(params);
Iterator results = query.iterate();
while (results.hasNext()) {
Object[] object = (Object[])results.next();
for (int i=0; i < object.length; i++) {
....
}
}
In the body of the for loop i can get the value
Code:
object[i]
and its type
Code:
query.getReturnTypes()[i].getReturnedClass()
but can i get back which attribute or column each value comesfrom?
thanks
Simon
Hibernate version:2.1.4
Mapping documents:Cat
Code between sessionFactory.openSession() and session.close():as above
Full stack trace of any exception that occurs:na
Name and version of the database you are using:MySql 4.1.2 alpha
Debug level Hibernate log excerpt:na