Joined: Wed Sep 28, 2005 5:05 am Posts: 11
|
Hi ;)
I´m using Hibernate 2.8.1 and MicrosoftSQL-Server.
My problem:
I have two tables with a one-to-many relation:
Table 1
Name: Adressen
Primary Key: __Org_RecordNo
column:Name (String36)
column:Number(int)
Table2
Name: Ansprechpartner
Primary Key: __Org_RecordNo
Foreign Key: AdressID
Column: Name(String36)
if i use the "normal" mapping the relation looks like this:
Mapping for Adressen:
...
<set inverse="true" name="AnsprechpartnerSet">
<key column ="AdressID"/>
<one-to-many class="Ansprechpartner"/>
</set>
I think that works fantastic. Now comes the PROBLEM:
The return-mapping from Ansprechpartner:
...
<many-to-one
name="Adressen"
column="AdressID"
class="Adressen"/>
That means, AdressID from Ansprechpartner references to __Org_RecordNo(PrimaryKey) from Adressen. But it have to show to the column Number of Adressen not to the primary key...a little confuse..but thats the given situation..
How can i map this?
|
|