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 with parent via join table. Parent don't have Agg object.
I am doing some filtering on Child2 i.e: " From Child2 ch2 WHERE ch2.field1 =... ch2.field2 =... etc."
How can I now join Child2 with Agg, without causing join with all subclasses tables. I simple want to join only with Child2 table (without joining with Child2, Child3, Child4)
I was trying to use 'class' property (i.e. ch2.class =...) the result is correct, but generated query contains join to every subclasses ;/
HQL "From Agg a Join a.l" also join with all sub-classes (even with ch2.class)
Thanks!