-->
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: many-to-one on one column and one constant
PostPosted: Tue Jul 04, 2006 5:28 pm 
Newbie

Joined: Tue Jul 04, 2006 5:23 pm
Posts: 2
If I have a table A, with column A1 and A2 and a table B with column B1. The association between A and B is B1 = A1 and A2 = 'some constant value'

How can I map this with Hibernate?

It appears that I can have associations on multiple columns by nesting a properties element, but I haven't been able to find a way of specifying that some column must have a constant value.

Hope the question make sense.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 04, 2006 6:50 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
That's a weird one. If the constant value was on the contained table, you'd use <set where="column=value" ...>, but if the constant value is on the containing table.. I think that's not possible. Wouldn't it be a discriminator in that case?

_________________
Code tags are your friend. Know them and use them.


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.