I want to filter objects based in some conditions or if their parent is of a specific type.
class A {}
class B extends A {}
class O {
A a;
long n;
}
I want all O objects where n > 100 or a is of type B.
In Criteria what would be the or condition
I’ve had bugs though when a single-table inheritance type was chosen (using a discriminator), and where I had to use
Note that
classis an implicit property. You don’t need to define anything special in the entity to make it work.