-->
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.  [ 2 posts ] 
Author Message
 Post subject: Get object by associated one
PostPosted: Wed May 20, 2009 10:17 am 
Newbie

Joined: Wed May 20, 2009 9:49 am
Posts: 11
I have class Game that has collection of players. This snippet is from Game.hbm.xml:
Code:
        <set name="players" access="property" table="players" cascade="all">
            <key column="game_id"/>
            <one-to-many class="Player"/>
        </set>
How can I get Game if I have one of its players? Without hql if it is possible :) Or maybe there is some method to get game_id from table players?
PS: I use Spring's HibernateTemplate, maybe it has its methods to do this, but I cannot find it.


Top
 Profile  
 
 Post subject: Re: Get object by associated one
PostPosted: Wed May 20, 2009 10:19 am 
Newbie

Joined: Wed May 20, 2009 9:49 am
Posts: 11
sorry, i doubled my topic. Moderators, kill this one, please.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.