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: If fetching is LAZY, why don't I see proxy classes?
PostPosted: Thu Apr 10, 2008 2:15 pm 
Regular
Regular

Joined: Thu Nov 30, 2006 10:48 am
Posts: 59
If I have a collection of PVH objects in my class, PV, and the mapping specifies that LAZY fetching is used for the collection, shouldn't the following HQL for the PV class result in the PV object having a collection of PVH proxy objects?

list = (session.CreateQuery("from PropertyValue pv")).List();

Instead, the PV object's PVH collection is null. Am I missing something?

DETAILS:

public class PV
{
public virtual IList<PVH> PVHValues { ... }
}

public class PVH
{
public virtual PropertyValue PVParent { ... }
}

<class name="PV, Domain" table="dbo.tblPV">
<bag name="PVHValues">
<key column="PVID"/>
<one-to-many class="PVH, Domain"/>
</bag>
</class>

<class name="PVH, Domain" table="dbo.tblPVH">
<many-to-one
name="PVParent"
column="PVID"
class="PV, Domain"
/>
</class>

_________________
metazone


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 29, 2008 9:51 pm 
Regular
Regular

Joined: Thu Nov 30, 2006 10:48 am
Posts: 59
FYI - I found the problem. I have a db trigger on the table associated w/ the PV class that adds records to the table associated w/ the PVH class for updates and deletes. In my unit testing, I added records to the PV class, updated them (all w/in transactions) and then when I queried for the PV object, I didn't see the PVH objects. Only when I closed the Session and recreated it did I.

_________________
metazone


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.