If I have a mapped class hierarchy
A extends B extends C
B has a property
private String surName;
and accessors
public String getSurName(){...}
public void setSurName(String value) {...}
Can I create a
Criteria criteria = session.createCriteria(A.class);
then add a
Restrictions.sqlRestriction("soundex({alias}.sur_name) like soundex(?)", myName, Hibernate.STRING)
Since the surName property is in class B the sqlRestriction can't find the correct column sur_name.
Any suggestions on how to approach writing a query with an sqlRestriction against a mapped hierarchy would be appreciated.
|