-->
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: One to One Mapping Problem
PostPosted: Fri Oct 14, 2011 8:38 am 
Newbie

Joined: Fri Oct 14, 2011 8:20 am
Posts: 1
Hello,

I required help on a scenario.

I have two classes

public class Product
{
public virtual string Id { get; set; }
public virtual extproductinfo ExtProductInfo { get; set; }
}

public class extproductinfo
{
public virtual string productid{ get; set; }
public virtual Product Product { get; set; }
}

Mapping file goes like this:-

<class name="Product">
<id name="Id" />
<one-to-one name="ExtProductInfo" class="iSTAR.Data.extproductinfo, iSTAR.Data" constrained="false" />
</class>

<class name="extproductinfo">
<id name="productid" />
<one-to-one name="Product" class="iSTAR.Data.Product, iSTAR.Data" constrained="true" property-ref="Id"/>
<property name="flags" />
</class>

Both the tables have same column as Primary Key i.e ProductId in extProductInfo and Id in Product. I require one-to-one mapping between the two tables. The mapping works fine.

But now I require to remove Productid from "extproductinfo". Can I define Id attribute of "Extproductinfo" in <one-to-one > mapping. It doesn't seem possible to.

Please help.


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.