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