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: Mapping one entity to several tables & association
PostPosted: Mon May 11, 2009 7:51 am 
Newbie

Joined: Sun Apr 05, 2009 8:00 am
Posts: 8
hi
if i have one entity mapped to 2 tables like that :

Code:
   <class name="Entity1" table="Entity1">
      <id name="Member1" column="Member1" type="Int32">      
                  <generator class="native"/>
      </id>
      <property name="Member2" column="Member2" type="String" not-null="true" />
      <join table="table2">
         <key column="Member1" unique="true" />
         <property name="Member3" column="Member3" type="String" not-null="true" />
         <property name="Member4" column="Member4" type="String" not-null="true" />
      </join>
   </class>


and i have another entity where there is association between the two entities

for Entity1:
should i put the foreign key in the 2 tables ??


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.