Hi,
Can some one help me to write to_number in order-by clasue. The following mapping giveing me an SQLException
Code:
<set name="myList" inverse="true" lazy="false" cascade="all" where="result_type='OUTPUT' and decision='R'" order-by ="SORT_PRIORITY DESC, ACCURACY DESC" batch-size="30" fetch="join">
<key>
<column name="REQUEST_ID" />
</key>
<one-to-many class="com.MyRequestVO"/>
</set>
The generated query is
Code:
select mylist0_.REQUEST_ID as REQUEST1_1_, mylist0_.PASSPORT as PASSPORT3_0_, mylist0_.DECEASED_DATE as DECEASED15_3_0_, mylist0_.NAME as NAME3_0_, mylist0_.PRIORITY as PRIORITY3_0_, mylist0_.SORT_PRIORITY as SORT21_3_0_ from REQUEST_LINE_RESULT mylist0_ where mylist0_.result_type='NESS_OUTPUT' and mylist0_.decision='R' and mylist0_.REQUEST_ID=? order by mylist0_.SORT_PRIORITY DESC, mylist0_.TO_NUMBER(ACCURACY) DESC
org.hibernate.exception.SQLGrammarException: could not initialize a collection: [com.EntityMapVO.myList#component[requestId]{requestId=79600}]
Caused by: java.sql.SQLException: ORA-00904: "MYLIST0_"."TO_NUMBER": invalid identifier