-->
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: advanced polymorphic queries
PostPosted: Wed May 12, 2004 2:35 am 
Newbie

Joined: Wed May 12, 2004 2:26 am
Posts: 2
Location: san francisco, ca
i'm using implicit polymorphism with the table-per-subclass inheritance scheme (though i could be argued to try another scheme if it helps). i'm trying to write a query that would do something like:

say, eg.MeanCat extends eg.Cat and adds a property irritability..

from eg.Cat as cat
where (cat.class = eg.MeanCat and cat.irritability > 5)
or (cat.class = eg.DomesticCat)

which would then select all domestic cats and mean cats with irritability greater than 5. of course right now when i try this, the subclass' properties aren't found in the superclass, which is understandable.

in short, is there any way to "cast" in HQL?


Top
 Profile  
 
 Post subject: Re: advanced polymorphic queries
PostPosted: Wed May 12, 2004 2:47 am 
Expert
Expert

Joined: Fri Feb 06, 2004 7:49 am
Posts: 255
Location: Moscow, Russia
visnup wrote:
in short, is there any way to "cast" in HQL?

http://forum.hibernate.org/viewtopic.php?t=928293
gavin wrote:
It is not possible at this time...


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.