I have something like the following
@MappedSuperclass public abstract class Foo {
@Column private String myId;
}
@Entity public class Bar extends Foo {
}
@Entity public class Baz extends Foo {
}
But I now want to query for all instances of Bar and Baz using myId but my query gets rejected:
org.hibernate.hql.ast.QuerySyntaxException: Foo is not mapped [from
Foo foo where foo.myId = :myId]
Can you query sucessfully on the 2 entitys if you query each one seperately ?
Something like:
?
The answer is due to only having tables for concrete classes, if you look here
clearer answer to identical question