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: Multiple one-to-one relations
PostPosted: Wed Dec 13, 2006 6:05 am 
Newbie

Joined: Thu Nov 16, 2006 10:01 am
Posts: 5
Hi,

I have a table which has more than two one-to-one relationships with other tables. I am using foreign generator class to generate the ids for the persistent objects. But if I use the property param more than one time I got an error. What can I do?

The code:

Customer.hbm.xml
<class name="Customer" table="Customer">

<id name="CustomerId" column="CustomerID" type="Int32" unsaved-value="0">
<generator class="foreign">
<param name="property">Shop</param>
<param name="property">Market </param>
</generator>
</id>

<one-to-one name ="CustomerId" class="Shop" constrained="true"/>
<one-to-one name ="CustomerId" class="Market" constrained="true" />


Shop.hbm.xml:
<id name="CustomerId" column="CustomerID" type="Int32" unsaved-value="0">
<generator class="assigned"/>
</id>

<one-to-one name="CustomerId" class="Customer"/>

Market.hbm.xml:
<id name="CustomerId" column="CustomerID" type="Int32" unsaved-value="0">
<generator class="assigned"/>
</id>

<one-to-one name="CustomerId" class="Customer"/>


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.