-->
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: many-to-one, but different column names
PostPosted: Wed Oct 18, 2006 1:19 pm 
Newbie

Joined: Wed Oct 18, 2006 12:59 pm
Posts: 2
Hello,

have two tables:

Table1
+key-component1
+key-component2
+key-component3
+key-component4

Table2
+key-component1-difname
+key-component2
something1
something2

I want to make relations between these two tables like:

Table1 (many-to-one) -> Table2

I tried (in Table1 hbm file):

<many-to-one name="table2" class="Table2" lazy="false" insert="false" update="false">
<column name="key-component1"/>
<column name="key-component2"/>
</many-to-one>

I know how that there would be no problems if names are the same, but there is "key-component1-difname" in Table2.

Is there any solution for this? I tried with "foreign-column" attributes, but without success :(


Top
 Profile  
 
 Post subject: Re: many-to-one, but different column names
PostPosted: Fri Oct 20, 2006 12:08 pm 
Newbie

Joined: Wed Aug 03, 2005 6:49 pm
Posts: 9
Code:
<many-to-one name="table2" class="Table2" column="foreignKey"/>


Top
 Profile  
 
 Post subject: Re: many-to-one, but different column names
PostPosted: Mon Oct 23, 2006 6:16 am 
Newbie

Joined: Wed Oct 18, 2006 12:59 pm
Posts: 2
CenkCivici wrote:
Code:
<many-to-one name="table2" class="Table2" column="foreignKey"/>


But, I have composite Id (+key-component1-difname, +key-component2 ) not just one column.


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.