-->
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.  [ 1 post ] 
Author Message
 Post subject: polymorphic queries
PostPosted: Wed May 25, 2005 6:08 pm 
Newbie

Joined: Wed May 25, 2005 5:50 pm
Posts: 1
i read the corresponding chapter in the manual but i am not sure what is the best way to do the following:

Company is an abstract type. Concrete subtypes are bank and corporate group. Bank has a bool-attribute branch. I want to query all corporate groups and all banks which are no branches.

My first approach would:

from CompanyHPB as comp, BankHPB as bank
where bank.branch = true

But aren't here objects getting retrieved multiple?
What does "from CompanyHPB as comp, BankHPB as bank" exactly mean? Using such a statement in SQL, records would be retrieved twice, wouldn't they?

I just want to apply a criteria only if the object is of a certain subtype (bank).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.