hi,
i'm trying to use a native query and retrieve the results. the following code executes a simple query. the first println() reports a list size of 23, so i know objects are being returned. however, the row array has a size of zero! what's going on here?
Code:
String sql = "select category, category_key from categories where category_id < 30";
SQLQuery query = session.createSQLQuery(sql);
try {
List tuples = query.list();
Iterator iter = tuples.iterator();
System.out.println(tuples.size());
while(iter.hasNext()) {
Object[] row = (Object[] )iter.next();
System.out.println(row.length);
String cat = (String )row[0];
String key = (String )row[1];
}
} catch (HibernateException e) {
System.out.println("hib exception");
e.printStackTrace();
}
thanks,
mc