Given the following entity definitions:
@Entity
class abstract A {
Collection<A> parents;
}
@Entity
class B extends A {
}
@Entity
class C extends A {
}
is it possible to define a method which returns all entities of type B & C having a given parent, without having to make two separate calls and then merging the results?
Collection<A> getAllByParentId(long id)
It should be as simple as this: