Hi, I posted a thread on the forum : Invalid alias in a @Where clause with @Inheritance(JOINED) - Hibernate ORM - Hibernate The issue is that if I have a model with a JOINED class hierarchy, and I have a predicate in the @Where annotation that references an attribute of the parent class, Hibernate automatically assigns the alias to the child class instead of the parent class.. This scenario occurs when an object "Foo" has a collection of objects "Bar" that inherit from the class "BAZ," which has an attribute "qux" and the "@Where" annotation that adds a predicate on "qux". During the loading of the collection “Bar” of the object “Foo”.
@Inheritance(JOINED)
@Entity @Where(clause="qux=0")
class Baz {
private int qux= 0;
}
@Entity
class B extends A { }
@Entity class C { Set<B> setOf; }
|