我有一个类的Hiberante HQL剂量不承认甲骨文替换功能
class A {
String aField;
String bField;
}
class B {
A classAField
}
我使用的限制,构建HQL
Restrictions.like(propertyName, obj);
我封闭了的Oracle SQL功能可按替换propertyName删除所有空格,所以propertyName是
replace(classAField.aField,' ')
和我得到了以下错误
could not resolve property: replace(classAField of: B; nested exception is org.hibernate.QueryException: could not resolve property: replace(classAField of: B
hiberante无法识别pl/sql函数。 我使用Oracle 10g中diaglect
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
is there a work around here?
非常感谢
thanks.how做出的Hiberante使用替换,而不是使用sqlRestriction – sse 2013-02-25 04:04:56
您可以在参数sqlRestriction使用它的功能。 – 2013-02-25 10:10:59
问题是我不能为所有实体使用sqlRestriction。我需要替换一个实体的特定属性。所以我需要知道映射的列名和表别名。 – sse 2013-02-25 19:46:58