ok i will try to explain my use case in more detail. So i have a parent class like this one (abstract or not it doesn't matter):
Code:
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class AbstractEntity {
(..)
private String commonProperty;
(..)
}
and two child classes:
Code:
@Entity
public class FirstEntity extends AbstractEntity {
(..)
}
Code:
@Entity
public class SecondEntity extends AbstractEntity {
(..)
@OneToMany(mappedBy="secondEntity")
@OrderBy("commonProperty desc")
private Set<FirstEntity> firstEntities;
(..)
}
When the collection is loaded in the SecondEntity, the following exception is fired:
Code:
Hibernate: select firstentity0_.commonProperty as commonProperty3_28_0_, firstentity0_.secondEntity_id as secondEntity1_33_0_ from firstentity firstentity0_ where firstentity0_.secondEntity_id=? order by AbstractEntity.commonProperty desc
21:06:01 ERROR (org.hibernate.util.JDBCExceptionReporter.java:78)
ERROR: missing FROM-clause entry for table "abstractentity"