-->
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.  [ 2 posts ] 
Author Message
 Post subject: Getting the return value of an Aggregate functions
PostPosted: Thu Apr 01, 2004 12:23 pm 
Newbie

Joined: Thu Feb 19, 2004 10:25 pm
Posts: 16
Hi all,

I have this query:

Query locationQuery = session.createQuery("select count(*) " +
"from Location as location where " +
"location.comp_id.lsecurityId = :securityCode and location" +
".lcellStatus is not null");

assuming that the syntax is correct, how do I get the 'count' value out of the query object?

TIA,

_________________
-Scott-


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 01, 2004 11:45 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The count(*) aggregate function has a return type of Hibernate.INTEGER, eg, Java Integer. When you do qry.find(...) you will get a list with one element that is an Integer.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.