-->
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.  [ 2 posts ] 
Author Message
 Post subject: Single-ended association proxies
PostPosted: Mon Jul 07, 2008 3:49 am 
Newbie

Joined: Mon Jul 07, 2008 12:38 am
Posts: 2
Hello,

I am witnessing some unexpected behaviour with my many-to-one lazy-loading relationships.

The object that is being loaded by proxy has a base class with members that are also mapped.

ie:

class A
{
property AA
}

class B:A
{
property BA
}

and mapping

...
<property name="BA" column="ba"/>
<property name="AA" column="aa"/>
...


now when class B is loaded via proxy
<many-to-one name="B" column="bID"/>

only the property of class B is being loaded (BA), and not the property of class A (AA).

i only get this issue for single-ended proxies, the collection proxies seem to work fine.

if i set lazy=false for the many-to-one association, then the problem goes away, which makes me think it must be something to do with the proxy

if anyone has any ideas what is happening here it would be much appreciated

cheers,

matt


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 08, 2008 3:18 am 
Newbie

Joined: Mon Jul 07, 2008 12:38 am
Posts: 2
it seems like this was a problem around virtual members

class A had some none-virtual properties, but these were defined on an interface which class A implemented.

The seems to have had the result of nhibernate not complaining when it tried to create the proxy (as it would if the properties were defined on the object and not an interface), and instead just loading nulls for those non-virtual properties when objetcs were accessed by proxy.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.