-->
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: Specifying a static foreign key in a mapping file.
PostPosted: Mon Dec 12, 2005 12:25 am 
Newbie

Joined: Tue Mar 22, 2005 6:01 pm
Posts: 13
Location: Sydney, Australia
Hi there,

I want to map a property in my class to an entity using a <many-to-one> relationship.

So far all the Many-To-One relationships i've used specify a column for the foreign key of the required entity. But in one case i actually want to specify a value (some instance of the primary key) rather than the foreign key column name.

So rather than looking up an entity based on the value in the foreign_key column. I want the entity retrieved based on the its primary key being equal to some value that i specify in the mapping file.

I'm hoping and guessing that this is possible. But i'm not sure how to do it.

Hope someone knows this and is kind enough to share their knowledge with me.

Thanks in advance.
Johnny


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.