The following code comes from the section "9.3.1. Scalar queries" in the Hibernate documentaion
Iterator results = sess.iterate(
"select cat.color, min(cat.birthdate), count(cat) from Cat cat " +
"group by cat.color"
);
while ( results.hasNext() ) {
Object[] row = results.next();
Color type = (Color) row[0];
Date oldest = (Date) row[1];
Integer count = (Integer) row[2];
.....
}
When I put this code into Eclipse, I get the following error for the line:
Object[] row = results.next();
Type mismatch cannot convert Object to Object[]
Can anyone suggest the correct line of code for this statement.
Thanks for your help in advance.
Judy
|