我有一個類的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