-->
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: criteria search: grouping with multiple criterias
PostPosted: Fri Feb 29, 2008 4:25 am 
Newbie

Joined: Fri Feb 29, 2008 3:44 am
Posts: 3
hibernate-3.2.5.ga

hi together,

In the following scenario i want to do a search by "artistName", wich should delivers me a grouped result of all "media" containing the specified artist.

my problem is now, that there is a quite nested structure between the media and the artist...

My mapping consits of the following classes.
Code:
Media.class
Set<Mediums>

Medium.class
Set<Titles>

Titles.class
Set<Artists>

Artist.class
artistName


This was my first try which works fine, but unfortunately without grouping.
I get as many "Media" objects back, as "Artists" are mapped to a "Title".
Code:
....
sessionFactory.getCurrentSession().createCriteria(Media.class)
.createCriteria("mediums")
.createCriteria("titles")
.createCriteria("artists")
.add(Restrictions.like("artistName", artistName))
.list();
...


how would a "group by Media" would like for this example?

thx a lot for your help!


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.