-->
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.  [ 5 posts ] 
Author Message
 Post subject: How to load only the super class part of a class?
PostPosted: Thu Oct 07, 2004 1:27 pm 
Regular
Regular

Joined: Tue Sep 28, 2004 6:34 pm
Posts: 50
I have case where I have class A and joined-subclasses B, C. The data is in 3 tables. All queries on base class are resolved as joins to B and C. For performance reasons I would like to use base classes table ONLY to load super class part of all instances, is there a way to do this without specifying all the properties?

Thanks for ideas,
Lukasz


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 07, 2004 2:00 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
check implicit, explicit words in the reference guide

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 07, 2004 4:07 pm 
Regular
Regular

Joined: Tue Sep 28, 2004 6:34 pm
Posts: 50
I assume that you are speaking about:
<class
polymorphism="implicit|explicit"

it sound fine, but this is controlled in configuration layer and I am looking for something that could be controlled in application layer - in query string.

I would like to use both implicit and explicit :)

Workaround for this would be an ability to set <joined-subclass lazy=


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 07, 2004 4:14 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
Likewise, the special property class accesses the discriminator value of an instance in the case of polymorphic persistence. A Java class name embedded in the where clause will be translated to its discriminator value.

from eg.Cat cat where cat.class = eg.DomesticCat

it's in the reference guide....

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 07, 2004 5:33 pm 
Regular
Regular

Joined: Tue Sep 28, 2004 6:34 pm
Posts: 50
I think I am looking for opposite idea.

Let say I have mapping:
Code:
   <class name="Cat" >
      <property name="name"/>
      <property name="nickName"/>

      <joined-subclass name="DomesticCat">
            <property name="owner" />
            <property name="picture" .."LOB" />
      </joined-subclass>
      <joined-subclass name="WildCat">
            <property name="forestName" />
      </joined-subclass>
   </class>


I have Cats, Wild Cats, and Domestic Cats.
Now I would like to display a list of all cats using general cat information only (the one from base Cat class). I would like to get instances of Cat class including Cats, Wild Cats, and Domestic Cats. But I do not want the hibernate engine to load subclass specific data - especially LOB's:)

Does any one have an idea how to load superclass specific data only?

Lukasz


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