-->
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: Collection retrieval query does not use discriminator
PostPosted: Wed Aug 16, 2006 11:27 am 
Newbie

Joined: Wed Aug 16, 2006 11:08 am
Posts: 1
Hibernate version:3.2.0.cr2 From JBoss 4.04GA

Oracle 9.2_06

We have implemented one table per class hierachy and have an abstract Companies class with subclasses for each of the specific company types in our system (and the relevent discriminators).

The GroupCompany is the parent of BrandCompany (amongst other types) so has a collection of "brands". However when we get the brand companies collection it doesn't use the discriminator and just runs "select * where id_parent = X". Unfortunately since we have other company types that have the GroupCompany as its parent this means we get all of them (all wrapped in BrandCompany objects!).

If we use force=true then this solves this (as per this post http://forum.hibernate.org/viewtopic.php?t=949895).

My question is this why do we have to use force = true??

Surely if I have mapped the brands collections of the GroupCompany as a BrandCompany (as oppose to a Company) - which I have, then it should always use the discriminator in the query irrelevent of the force attribute?

This sounds like a bug or if not then the documentation could do with being updated to refelect the impact of this..

Laurence


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.