-->
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 and lazy
PostPosted: Fri May 18, 2007 9:36 am 
Beginner
Beginner

Joined: Mon Mar 06, 2006 2:19 pm
Posts: 42
Location: Belo Horizonte, Brazil
Hibernate version:
NHibernate-1.2.0.GA
Mapping documents:

Hi. I had a relationship 1:1 that was not working well. The accessors and the the member variables of the :1 was not matching when the class was lazy loaded.

Code:
class Foo
{
private long id;
private int anyValue;

public long Id
{get;set;}

public int AnyValue
{get;set;}
}


If I load Foo with get or load there is no problem. But lazy loading Foo,
foo.AnyValue != foo.anyValue.

I was pretty sure that my mapping was correct. I tried a lot of things like constrained, outer-join, cascades, but the only thing that worked was to set lazy to false at the many-to-one side.

I understand that this can be the correct behaviour of NHibernate, but I think that it could be more clear documented. If not, anyone can point it to me?

If I am right I hope this post can help others with the same problem.


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.