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: Lazy loading issue
PostPosted: Wed Apr 15, 2009 4:53 pm 
Newbie

Joined: Wed Apr 15, 2009 3:33 pm
Posts: 1
i have unidirectional many-to-one mapping between two classes, both are set to lazy and all fields are virtual and public empty default constructors are available.

I am using spring's HibernateTemplate and when i use Get(A, id) then lazy loading works fine but if i retrieve a named query from the xml (e.g. from A as a where a.score > :score) then i get object "b" initialized. Also, the object "b" in wrapped inside the dynamic proxy (i can see it in the debugger) but what I don't understand is why is it getting initialized on it's own. Any clues pointers would be appreciated

Code:
<class name="Project.Data.Domain.A, Project.Data" table="a" lazy="true">

...

<many-to-one name="B" class="Project.Data.Domain.B, Project.Data">
      <column name="bId" not-null="false" />
</many-to-one>

...

</class>


<class name="Project.Data.Domain.B, Project.Data" table="b" lazy="true">

...

</class>


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.