-->
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: Nhibernate mapping for long
PostPosted: Fri Mar 13, 2009 1:19 pm 
Newbie

Joined: Fri Mar 13, 2009 10:36 am
Posts: 10
Hi All,

I have a class A as follows

class A
{
long id;
string text;
B _bee;

//getter setter

public B Bee
{
get { return _bee; }
set {_bee= value;
_bee.aid = id;
}


}
} //END OF CLASS A

class B
{
long bid;
string text;
long aid;

//getter setter
}

The mapping for class A to B is as follows

<one-to-one name="Bee" class="B" cascade="save-update" fetch="select" property-ref="aid" />

Based of the code above what I am trying to do is set the value in class B for aid when Class A is saved.

However on saving class A I always get the value of aid as 0.

Is there anything I can do to get the correct value of aid?


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.