-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: rowCount ClassCastException (Long instead of Integer?)
PostPosted: Tue Jun 08, 2010 4:14 am 
Regular
Regular

Joined: Thu Nov 26, 2009 8:45 am
Posts: 78
Hi there,

i upgraded from Hibernate 3.2.6 to Hibernate 3.5. Up to now, i get this code working:

Code:
crit.setProjection(Projections.rowCount());
Integer result = ((Integer)crit.list().iterator().next()).intValue();   


3.5. tells me, that rowCount is returned as a Long, didnt find that in the javadoc. Is it an API change, when did it happen?

edit: and are there any other changes like this i need to know about (errors obv appearing at runtime only, dont want my customers to find all the errors for me :) )


Top
 Profile  
 
 Post subject: Re: rowCount ClassCastException (Long instead of Integer?)
PostPosted: Tue Jun 08, 2010 4:37 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Seems like it has been a known issue a long time that was fixed in 3.5. A similar change was made for HQL a long time ago. Read http://opensource.atlassian.com/project ... e/HHH-1724
for more information. There is a wiki page (http://community.jboss.org/wiki/Hiberna ... tionGuides) collecting migration information, but none yet for Hibernate 3.5.


Top
 Profile  
 
 Post subject: Re: rowCount ClassCastException (Long instead of Integer?)
PostPosted: Tue Jun 08, 2010 5:01 am 
Regular
Regular

Joined: Thu Nov 26, 2009 8:45 am
Posts: 78
Ok, thx 4 your reply. Is it possible to name a date, when the migration guide to 3.5. will be available?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.