-->
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: Is there any benefit using subclass?
PostPosted: Wed Sep 22, 2004 6:51 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
Hi everyone:

Is there any benefit if I use the <subclass> ? What situation should I use it? I take a test use it. I found that if I query parent object like
Code:
from parent
, all the object including son object would be query! why it do this in this way? Could someone tell me what time should I use subclass function ? THks!

_________________
You are not alone...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 22, 2004 8:39 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
be sure to understand implicit and explicit polymorphic query...

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


Top
 Profile  
 
 Post subject: :(
PostPosted: Wed Sep 22, 2004 9:26 pm 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
anthony wrote:
be sure to understand implicit and explicit polymorphic query...


I see this article http://www.hibernate.org/hib_docs/reference/en/html/queryhql.html.
But I don't know what benefit using subclass. The element
Code:
polymorphism (optional, defaults to implicit): Determines whether implicit or explicit query polymorphism is used.
decide whether I will use polymorphism. It means that if I set the polymorphism to false, hibernate will query parent object only without children. If I set the plymorphism to true,hibernate will query all the object (parent and children).

But the problem is that I don't know what situation that I need query all parent and children object. Could you give me an example ? Thks!

_________________
You are not alone...


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.