In my domain model, I have the following classes. "UserProfile" has one "SecurityPrincipal"
class SecurityPrincipal{
private String loginId;
private String password;
private Date registeredData;
private int status;
}
class UserProfile {
private String name;
private String company;
private SecurityPrincipa principal
}
I want to get the sorted results of UserProfile objects and works fine for simple properties. how
DetachedCriteria criteria=DetachedCriteria.forClass(UserProfile.class);
criteria.addOrder(Order.asc("name");
But when I try to access the properties of the internal bean (SecurityPrincipal instance), for example
criteria.addOrder(Order.asc("principal.status");
Sleep mode throws an error:
: org.hibernate.QueryException: : securityPrincipal.status of: com.bigg.ibmd.usermanagement.model.UserProfile org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:44) org.hibernate.persister.entity.AbstractPropertyMapping.toColumns(AbstractPropertyMapping.java:59) org.hibernate.persister.entity.BasicEntityPropertyMapping.toColumns(BasicEntityPropertyMapping.java:31)
?