-->
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: What's the different between polymorphism=implicit|explicit?
PostPosted: Wed Feb 04, 2004 11:23 pm 
Regular
Regular

Joined: Wed Dec 03, 2003 9:41 pm
Posts: 87
In <class> tag, there is an attribute named polymorphism. I read online docs but not understant the different well. May somebody explain it detail or give an example?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 04, 2004 11:33 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
It has to do with Hibernate's support for "polymorphic" queries. Say you have a class named Person mapped plus two others named Student and Instructor both of which extend from Person. Further, say you've mapped Student with explicit polymorphism and Instructor with implicit. In that case any queries looking for the Person class would return back not only all Person objects matching the criteria, but also all Instructors as well since it was mapped with implicit polymorphism.

Basically, explict polymorphism tells Hibernate not to return these instances during a query unless that class is explicitly named in the query, not just because one of its superclasses was named.

HTH


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 23, 2004 12:06 am 
Beginner
Beginner

Joined: Wed Mar 03, 2004 6:02 am
Posts: 46
Location: Kuala Lumpur, Malaysia
Suppose I have a class hierachy using joined-subclass method; is there a way to mimic the polymorphism=explicit feature ? i.e. I don't want some subclasses to ever be returned in queries. The reason I'm asking is because the <joined-subclass> tag does not have the polymorphism attribute as in the class tag.

Merci beaucoup

alistair


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.