-->
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.  [ 4 posts ] 
Author Message
 Post subject: Lazy loading of subclasses using joined inheritance
PostPosted: Thu Jan 05, 2006 3:40 am 
Newbie

Joined: Thu Jan 05, 2006 3:28 am
Posts: 1
I am using Hibernate3.1 and want to know how to lazy load my subclasses .

following is a sample of my mapping file

<class name="com.sit.cse.util.model.Supplier" optimistic-lock="version" table="Supplier">
<id name="id" column="ID" type="long">
<generator class="increment"/>
</id>
<property name="category" column="category" type="string" />
<property name="name" column="name" type="string" />
<property name="version" column="version" type="integer" />

<joined-subclass name="com.sit.cse.util.model.Expert" table="Expert">
<key column="id"/>
<property name="cv" column="cv" type="string" />
<property name="speciality" column="speciality" type="string" />
</joined-subclass>
</class>

I tried to use lazy="true" flag with Joined subclass but it does not seem to work.Each time I try to fetch the Supplier it uses an outer join get the Experts also which I don not want .

Is there some way of fixing this problem ?

Any help would be appreciated .


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 8:13 pm 
Beginner
Beginner

Joined: Mon May 24, 2004 7:39 pm
Posts: 37
Location: Charlotte
Hello,

Has anybody found a solution to this?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 01, 2007 6:28 am 
Newbie

Joined: Thu Feb 01, 2007 6:23 am
Posts: 1
I have the same problem. I have a superclass and joined-subclasses like this:

class A
* joined-subclass B
* joined-subclass C

B and C extend A. When I make a query on A I always get a SQL query which makes an outer join with B and C. I am only interested in the data from A. B and C will be loaded when needed.

I tried everything. Lazy="true" doesn't have effect on the joined-sublass. The polymorphic attribute "explicit" doesn't either. Also, setting the "class" attribute in the criteria query brings nothing.

The problem is that table A is really big, and also B and C. This results in a very slow query.

How can this be solved?

Greetings
Jan


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 26, 2007 4:07 pm 
Newbie

Joined: Wed Apr 07, 2004 6:13 pm
Posts: 18
Interested in the solution for this as well... if this is not by design.

_________________
Thanks,
Aaron


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.