Hi!
There is a little mistake in the example code of the documentation in the section:
11.4.1.3. Scalar results
Code:
while ( results.hasNext() ) {
Object[] row = results.next(); <--- needs a cast
Color type = (Color) row[0];
Date oldest = (Date) row[1];
Integer count = (Integer) row[2];
.....
}
there needs a cast in the line marked
Code:
Object[] row = (Object[])results.next();
But not all the time because may be only 1 object the result,
in that case, there must be:
Code:
Object row = results.next();
it depends on the HQL sentence.
Cheers
Ahumaro[/code]