Advertisement

09.20.2006 at 01:47AM PDT, ID: 21995885
[x]
Attachment Details

Group by query with HibernateTemplate.find()

Asked by integrosys in Java Programming Language

I used the HibernateTemplate.find(String query) method to query a table, say PLAYER (corresponding Java object is OBPlayer.java). The query is "from OBPlayer player where player.name='john'". This returns a List, with each element an OBPlayer object.

Now I want to do a group by query, say "select player.age,count(player.age) from OBPlayer player" to get the number of players by age. What does the List return then? How do I get the results I want?Start Free Trial
[+][-]09.20.2006 at 03:13AM PDT, ID: 17559243

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java Programming Language
Sign Up Now!
Solution Provided By: yongsing
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32