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.  [ 3 posts ] 
Author Message
 Post subject: ManyToMany Query how to ?
PostPosted: Wed Jul 07, 2010 6:40 pm 
Newbie

Joined: Wed Jul 07, 2010 6:33 pm
Posts: 6
I have the following mapping
Code:
<class name="system" table="system" catalog="dbx">
....
....
<set name="platform" inverse="true" lazy="true" table="platformsystemmap" fetch="select">
            <key>
                <column name="system_id" not-null="true" />
            </key>
            <one-to-many class="platformsystemmap" />
        </set>
....
....
</class>



How do I write a query to retrieve all the systems with platform with some id y ?


Top
 Profile  
 
 Post subject: Re: ManyToMany Query how to ?
PostPosted: Wed Jul 07, 2010 6:41 pm 
Newbie

Joined: Wed Jul 07, 2010 6:33 pm
Posts: 6
In general how do I write a query if a table has many-to-many mapping ?


Top
 Profile  
 
 Post subject: Re: ManyToMany Query how to ?
PostPosted: Thu Jul 08, 2010 2:48 am 
Newbie

Joined: Thu Aug 20, 2009 3:00 am
Posts: 11
Something like?:

SELECT s FROM System s JOIN s.platform p WHERE p.id=:y


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

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.