-->
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: 1-to-1 lazy loading
PostPosted: Wed Jul 04, 2007 9:36 pm 
Newbie

Joined: Tue Aug 22, 2006 1:25 am
Posts: 2
Location: Brisbane, QLD, Australia
Hibernate version:
3.2

Mapping documents:

Code:
<class name="A" table="A" schema="A">
   <id name="aKey" column="A_KEY" type="integer">
      <generator class="assigned" />
   </id>
   <one-to-one name="bA" property-ref="aA" entity-name="BA" constrained="true" fetch="select" lazy="proxy" />
</class>

<class name="A" table="A" schema="B" entity-name="BA" lazy="true">
   <id name="aKey" column="A_KEY" type="integer">
      <generator class="assigned" />
   </id>
   <many-to-one name="aA" column="A_A_KEY" class="com.xxx.A" />
</class>


Name and version of the database you are using:
DB2

Problem
I need my one-to-one association to be lazy loading. Especially as the two tables are in different schema and queries result in table locks. I followed the directions here (http://www.hibernate.org/117.html#A18) as you can see from my mapping but any instance of A.A that is returned by a query results in a select statement for the associated B.A instance being executed. For me, this can generate many more queries depending on the size of the result set returned (100 instances of A.A isn't unusual resulting in 100 extra queries).

Is there a way to make this truly lazy loading?

Thanks in advanced


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 08, 2007 7:27 pm 
Newbie

Joined: Tue Aug 22, 2006 1:25 am
Posts: 2
Location: Brisbane, QLD, Australia
Anyone?


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.