User Comments for the tutorial:

Hibernate Count Query

Total comments: 12      View Tutorial    Discuss: Hibernate Count Query



regarding debug the
hi really this sight is extremmely good for Hibernate learning persons .i am studing and practising since long time but i found some problem in this example "".can u suggest how i debugg the .i 

couldn't understand
count(*) returns only one value. I didn't understand why you are iterating thru and incrementing count. 

Very Useful
Its very useful to the persons who learning/starting their career in IT field...... But its not helpful for the persons who really doing in practical.... So Provide some more code and some more examples........ 

Modify the Query String SQL_QUERY = "select sum insurance.investementAmount),insurance.insuranceName from Insurance insurance group by insurance.insuranceName"; 

Something is not right..........
In the code why are you counting on the result set? The aggregate function should have given you the count. 

Hibernate count.Its correct
Count(*) will return the no. of records of particular id. 

Use it for learning
Use it only for learning...I don't think anyone should use this in their works. 

One more modified query
instead of that we can use Integer count = (Integer)session.createQuery(SQL).uniqueResult(); this count will return count value. No need to iterate. 

Improper embarassing ads
Hi, Can you please remove advertisement pertaining to lose weight on the web pages. Those ads show embarrassing pictures which cannot be viewed at office. I certainly feel bad to open your site from office just because of the improper ads. Please ha 

Error showing this code
An error is showing with this code:: init: deps-module-jar: deps-ear-jar: deps-jar: compile-single: run-main: Jan 11, 2010 3:01:26 PM org.hibernate.cfg.Environment <clinit> INFO: Hibernate 3.2.5 Jan 11, 2010 3:01:26 PM org.hibernate.cfg.En 

This good for the lerners and also need some Examples using the new tecnics,methods that are usefull in real time projects. Thanks  

Nice Post
It is very much helpul for me..thanx alot 

Related Tutorial and Articles
Hibernate Interview Questions

count in hibernate .
count in hibernate .  How to implements count in hibernate 

Hibernate Questions

how to debug parameters in the hibernate query
how to debug parameters in the hibernate query  how to debug parameters in the hibernate query 

Hibernate Interview Questions

Regarding Hibernate
Regarding Hibernate  Both JDBC and Hibernate are used to connect to database then whats the need of going to hibernate? What are the main differences? And could you let me know please 

Hibernate Questions

Hibernate Criteria Count Example
Hibernate Criteria Count Example  Example of Hibernate Criteria Count. Check the tutorial Hibernate Criteria Count. Check the Latest tutorials, articles and examples of Hibernate Framework. Thanks 

Hibernate Questions

Hibernate criteria count.
Hibernate criteria count.  How do we count rows using criteria in hibernate?   We can get the rows count using the Projections. My code is like this: Criteria criteria = session.createCriteria(getReferenceClass 

Hibernate Questions

Hibernate Criteria Count Distinct Example
Hibernate Criteria Count Distinct Example  I am learning Hibernate... Criteria Count Distinct. Can anyone tell me the best place to learn Hibernate Criteria Count Distinct? Thanks   Here is an example of Hibernate Criteria 

Hibernate Questions

Hibernate criteria count.
Hibernate criteria count.  How do we count rows using criteria in hibernate?   Create hibernate configuration file (hibernate.cfg.xml... create Persistent class ?Hibernate uses the Plain Old Java Object (POJO) classes 

Hibernate Questions

Hibernate  Hi i have 2 doubbts regarding Hibernate ,.. 1)Can we rename hibernate.cfg.xml? 2? can we use multiple mapping resource in file ? pls let me know soon 

Hibernate Questions

hibernate - Hibernate
I am sending links to you where u can find the solution regarding your query: Thanks 

Hibernate Questions

update count from session - Hibernate
update count from session  I need to get the count of how many rows got updated by session.saveOrUpdate(). How would I get this? Thanks, mpr