-->
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.  [ 3 posts ] 
Author Message
 Post subject: Inheritance
PostPosted: Thu Sep 01, 2005 5:30 pm 
Beginner
Beginner

Joined: Wed Jul 06, 2005 4:51 pm
Posts: 27
I am using joined-subclass ( table per subclass ) to model my subclasses. I have a use case where I would like to instantiate only the super class without instantiating the subclasses. When I give type as Base.class to criteria, hibernate is doing outer joins to all the sub class tables and is instantiating the appropriate sub classes. Is there a way to only get objects of base class. I see a 'lazy' attribute in the joined-subclass but I don't think that would prevent instantiating sub class.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2005 6:52 pm 
Senior
Senior

Joined: Wed Jul 13, 2005 4:31 pm
Posts: 142
Location: Seattle, WA
I think using polymorphism='explicit' would work.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 02, 2005 9:44 am 
Beginner
Beginner

Joined: Wed Jul 06, 2005 4:51 pm
Posts: 27
No, it didn't work. When I do a session.load the derived class is being instantiated even when I pass in the base class


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