Hi,
Assume i have:
@Inheritance(strategy = InheritanceType.JOINED)
public class Child extends Parent{
}
How can i do a selection of only the instances saved as a Parent, not as a Child.
Thank you
Hi,
Assume i have:
@Inheritance(strategy = InheritanceType.JOINED)
public class Child extends Parent{
}
How can i do a selection of only the instances saved as a Parent, not as a Child.
Thank you
Take a look at the bottom of section 14.9 of the Hibernate documentation:
The special property
class
accesses the discriminator value of an instance in the case of polymorphic persistence. A Java class name embedded in the where clause will be translated to its discriminator value.
from Cat cat where cat.class = DomesticCat
So I believe in your case you could use the HQL constraint ... where class=Parent
to filter out the instances of Child
.