graeder wrote:
If i execute an HQL select statement, referencing the pojo and it's properties, do I then have to iterate through the results and populate the pojo properties?
ex.
Iterator results = sess.createQuery(
"select cat.color, min(cat.birthdate), count(cat) from Cat cat " +
"group by cat.color")
.list()
.iterator();
while ( results.hasNext() ) {
Object[] row = results.next();
Color type = (Color) row[0];
Date oldest = (Date) row[1];
Integer count = (Integer) row[2];
.....
}
So in the while loop would I populate the pojo with the values from the Object[]?
No. The collection will be fully populated POJO objects.
You might want to read the docs and do some tutorials before you post any more questions because most people would tell you that now.