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
|