-->
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: how to manage the foreign key relationship
PostPosted: Thu Aug 16, 2007 8:57 pm 
Newbie

Joined: Mon Jul 09, 2007 9:32 am
Posts: 17
If I use this mapping, how they manage the foreign key relationship ? In the query, I didn't find FK. Do I miss anything ?

Thanks

Code:
<hibernate-mapping  default-lazy="false"  default-cascade="all">   
   <class name="com.Case" lazy="false" table="hi_case">      
      <id name="caseId" unsaved-value="null">
         <generator class="increment"/>
      </id>       
    <one-to-one name="customer" class="com.Customer" fetch="join" />      
      
      <set name="courtDates" table="hi_courtDate" fetch="join">
         <key column="caseId"/>
         <one-to-many class="com.CourtDate" />
      </set>
   </class>
      
   <class name="com.CourtDate"  table="hi_courtDate">
      <id name="courtDateId" unsaved-value="null">
         <generator class="increment"/>
      </id>
       <property name="courtName"/>
   </class>
   
   <class name="com.Customer"  table="hi_customer">
      <id name="customerId" unsaved-value="null">
         <generator class="increment"/>
      </id>   
      <property name="name"/>   
   </class>
</hibernate-mapping>


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.