-->
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.  [ 5 posts ] 
Author Message
 Post subject: How To count the data in hibernate
PostPosted: Thu Feb 18, 2010 1:00 am 
Newbie

Joined: Tue Sep 29, 2009 12:29 am
Posts: 2
Dear all

I am new to this topic.I want to count the data from database and also fetch the corresponding value for count....


Top
 Profile  
 
 Post subject: Re: How To count the data in hibernate
PostPosted: Thu Feb 18, 2010 8:11 am 
Regular
Regular

Joined: Thu May 07, 2009 5:56 am
Posts: 94
Location: Toulouse, France
see at https://www.hibernate.org/118.html#A2

_________________
everything should be made as simple as possible, but not simpler (AE)


Top
 Profile  
 
 Post subject: Re: How To count the data in hibernate
PostPosted: Fri Feb 19, 2010 1:00 am 
Newbie

Joined: Mon Feb 15, 2010 2:39 am
Posts: 4
How to use the Count Query. Hibernate supports multiple aggregate functions. when they are used in HQL queries, they return an aggregate value (such as sum, average, and count) calculated from property values of all objects satisfying other query criteria. These functions can be used along with the distinct and all options, to return aggregate values calculated from only distinct values and all values (except null values), respectively. Following is a list of aggregate functions with their respective syntax; all of them are self-explanatory.
count( [ distinct | all ] object | object.property )

count(*) (equivalent to count(all ...), counts null values also)

sum ( [ distinct | all ] object.property)

avg( [ distinct | all ] object.property)

max( [ distinct | all ] object.property)

min( [ distinct | all ] object.property)

_________________
r4 gold ds


Top
 Profile  
 
 Post subject: Re: How To count the data in hibernate
PostPosted: Fri Jun 17, 2011 9:53 pm 
Newbie

Joined: Fri Apr 29, 2011 3:21 pm
Posts: 6
This not correct?

i cant do a sum(distinct property)


Top
 Profile  
 
 Post subject: Re: How To count the data in hibernate
PostPosted: Sun Jun 19, 2011 11:24 pm 
Newbie

Joined: Fri Apr 08, 2011 6:15 am
Posts: 2
i only use sqlserver, ix, that is my way in c
select count id from "table"
fill in a table.
fetch the corresponding value for count: use datalist and key

_________________
free online Aircraft games


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