-->
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: Problem with nested table architecture
PostPosted: Wed Nov 30, 2005 5:34 am 
Newbie

Joined: Wed Nov 02, 2005 6:07 am
Posts: 12
Hi,
I've got a problem with a nested table architecture.

Table1:

Code:
<class name="Header" table="header">
<id name="DlvyNo" column="dlvy_no" type="java.lang.Integer"/>

<property name="BpCd" column="bp_cd" type="java.lang.String" />
<property name="BpOdsCd" column="bp_ods_cd" type="java.lang.String" />
<property name="CustNb" column="cust_nb" type="java.lang.String" />

<set name="lines" lazy="false" fetch="subselect" cascade="none" >
    <key column="dlvy_no" />
    <one-to-many class="Line"/>
</set>
</class>


Table2:

Code:
<class name="Line" table="line">
<composite-id>
     <key-property name="DlvyLiNo" column="dlvy_li_no" type="java.lang.Integer"/>
     <key-property name="DlvyNo" column="dlvy_no" type="java.lang.Integer"/>          
</composite-id> 

<property name="CatItCd" column="cat_it_cd" type="java.lang.String" />
</class>


Now I want to map a third table on the Line table as a one-to-one relation. But this table hast a composite key which contains columns from table1 AND table2.

Table3:

Code:
<class name="Stock" table="stock">
<composite-id>
   <key-property name="BpCd" column="bp_cd" type="java.lang.String"/>
    <key-property name="BpOdsCd" column="bp_ods_cd" type="java.lang.String" />
    <key-property name="CatItCd" column="cat_it_cd" type="java.lang.String" />
    <key-property name="CustNb" column="cust_nb" type="java.lang.String" />     
    <key-property name="VersCd" column="vers_cd" type="java.lang.String" />             
</composite-id>
</class>


Unfortunately I have to use these tables and cannot arrange them. Any ideas how it is possible to map this third table?


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.