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!