-
Mar 4th, 2012, 10:19 PM
#1
Help with nested select on relationship table in hql or criteria
Hi,
I have a relationship like below.
[Exercise] hasMany [Muscles]
it generates 3 tables
1. Exercise
2. Muscles
3. Exercise_Muscles
I'm trying to perform the following sql in hql form or criteria form.
"select a.* from Exercise a where a.id in (select distinct (b.id) from Exercise_Muscles b where b.muscle_id in (11,12))"
since the Exercise_muscles relationship table is not represented by a domain class, I'm having problem figuring out how to translate this sql into hql or criteria format.
Any tips that could point me in the right direction would be much appreciated.
thanks!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules