I am new to both the Java community and Hibernate. I am attempting to use date functions and then aggregate them. Here is what I am doing:
Code:
Iterator i = session.createQuery("select s.person, sum(s.viewed), sum(time_to_sec(timeEnd) - time_to_sec(timeStart))" +
"from SessionTrackerN s " +
"where s.districtId = 101902 " +
"group by s.person"
)
.setFirstResult(0)
.setMaxResults(20)
.list()
.iterator();
The "strange" thing is object returned contains only the first two columns of the result set. The debugger shows the third column is not there. No error is provided.
My meager dealing with Hibernate so far lead me to believe that a silent failure is either an unintended behaviour, or I have missed something.
I appreciate any light someone can shed on this!
My versions are
MySQL 4.0.23
Hibernate versino 2.1.8