Sorry if this is an old topic. I checked the Hibernate 3.2 migration guide and did some searching, but couldn't find anything.
Using
Hibernate 3.1.1, we have some Java code that does a simple count aggregation query to get a quantity of records. We cast the result to an Integer and return it.
I just
downloaded and tried 3.2 in the hopes that it would solve my problem of
not being able to get FULL JOINS to work under any circumstances. I routinely do LEFT and RIGHT joins across multiple tables, so I
thought I knew what I was doing. My database is
PostgreSQL 8.0.3 and I can do FULL joins in its query tool just fine.
Please, no one send me links to the reference documentation section 14.3 that claims Hibernate does full joins. Been there a billion times.
So with 3.1.1 the code below worked
but with 3.2 we get a ClassCastException. Is that a surprise to anyone, or does it simply mean
count queries now return long instead of int?
(which makes a lot sense when you think about it)
Code:
List x = session.createQuery("SELECT count(j) ...query text omitted...").list();
Integer i = (Integer) x.get(0);