-->
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: Joined-sublcass - lazy load the parent - possible?
PostPosted: Thu Jul 20, 2006 2:34 pm 
Regular
Regular

Joined: Wed Jun 29, 2005 11:14 pm
Posts: 119
Location: København
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Simple case of joined-sublcass.

Is there a way to load the subclass without the parent being loaded (e.g. have it lazy loaded?)

When I do count(id) on the subclass it does an inner join on the parent which is slow...

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 20, 2006 10:58 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
No. That would break object orientation: an object is made up of all its class' properties, and all its superclasses' properties. To load part of it would be loading part of an object.. so you'd be using property orientation. I think they call that COBOL.

Looks like you want a bidirectional one-to-one instead. That can be lazily loaded. Or maybe you want the superclass to be just the ID (to allow joins to subclasses), and then a separate class mapped to the same table, being the superclass properties class. Hmm.. might work.

_________________
Code tags are your friend. Know them and use them.


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.