-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: how to use TO_NUMBER in ORDER-BY clause
PostPosted: Mon Apr 21, 2008 5:56 pm 
Newbie

Joined: Fri Mar 28, 2008 12:18 pm
Posts: 3
Location: Tamp
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 14, 2008 11:05 am 
Newbie

Joined: Tue Jul 01, 2008 4:24 pm
Posts: 1
I am having a similar problem did you ever find a resoultion to this?

Thanks.

pHr3ak3r


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.