My model (InheritanceType.JOINED):
class Parent{...} class Child1 extends Parent{...} class Child2 extends Parent{...} class Child3 extends Parent{...} class Child4 extends Parent{...} class Agg{ List<Parent> l; }
Agg is connected to the parent through a connection table. The parent does not have an Agg object.
I am doing filtering on Child2 ie: "From Child2 ch2 WHERE ch2.field1 = ... ch2.field2 = ... etc."
How can I now join Child2 with Agg without causing joins to all subclass tables. I just want to join only the Child2 table (without joining Child2, Child3, Child4)
I tried to use the "class" property (ie ch2.class = ...), the result is correct, but the generated query contains a union for each subclass; /
The HQL "From Agg a Join al" is also merged with all subclasses (even with ch2.class)
Thanks!
source share