I have 2 classes:
Code:
@Inheritance(strategy = InheritanceType.JOINED)
class A {
public String getName()
}
class B extends A {
}
How can I access property
name in HQL for class B? I can't write only "name", because Hibernate searches for "name" only in class B. At least in following case:
I have third class C:
Code:
class C {
@OneToMany()
@OrderBy(...)
public List getListB()
}
When I use
@org.hibernate.annotations.OrderBy, it appends table name and dot before every column name - but column is in another table (becaouse of JOIN type of inheritance). So SQL statements results in error, because column with that name doesnt exists in table. When I use
@javax.persistence.OrderBy, it search for property name only in class B - so Hibernate says me "property does not exists".
What is the right way to do this? Is there any way how to tell Hibernate that some property should be found in full class hierarchy, or at least within parent class?
Thanks.
I use Hibernate 3.1 beta1 with Annotations 3.1 beta4.