-->
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 do i establish a forgien key relationship in the mapping
PostPosted: Mon May 16, 2005 10:38 am 
Newbie

Joined: Mon May 16, 2005 10:04 am
Posts: 1
I have two tables with a one to many relationship linked by id.
How do i establish a forgien key relationship in the mapping file.

I am using Hibernate 1.

Thanks
Biswajit

Here is my attempt:

<?xml version="1.0"?>
<hibernate-mapping schema="XXCUSTOMER_CONTACT">
<class name="com.xchanging.customercontact.CustomerContact" table="customer_contact" order-by="order_ asc">
<id name="id" column="ID"/>
<property name="companyName" column="COMPANY_NAME" />
<property name="description" column="DESCRIPTION" />

<list role="contactInfo" table="XXCUSTOMER_CONTACT.customer_contact_info" order-by="order_ asc">

<composite-element class="com.xchanging.customercontact.CustomerContactInfo">
<property name="label" column="LABEL_" />
<property name="descritpion" column="DESCRIPTION" />
</composite-element>

</list>

</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.