-->
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.  [ 1 post ] 
Author Message
 Post subject: Trying to create "rollup" using Criteria and Proje
PostPosted: Sat Nov 29, 2008 2:26 pm 
Newbie

Joined: Sat Nov 29, 2008 2:17 pm
Posts: 1
Hi all

I am trying to make a hibernate query using Criteria objects that will do the following... It will check which objects in the db have the same values for the attributes I specify. It will then roll those objects up into one row with a quantity when it returns.

For example, if my db contains, and I specify Name, Height, and Weight as my attributes to select:

Name Height Weight Location
Foo 10 5 Seattle
Foo 10 5 Sacramento
Foo 10 5 Portland
Foo 10 5 San Francisco
Bar 5 10 Los Angeles

then the result I want back is:

Quantity Name Height Weight
4 Foo 10 5
1 Bar 5 10


Has anyone done anything like this?
If you could share your solution that would be very helpful to me.
Thank you very much


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

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.