-->
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.  [ 3 posts ] 
Author Message
 Post subject: NVL function usage in Order.asc()
PostPosted: Wed Jan 07, 2009 3:11 pm 
Newbie

Joined: Wed Jan 07, 2009 2:58 pm
Posts: 2
NVL function usage in Order.asc() gives error message. COuld you please suggest if there is any alternate solution.

results = criteria.setFirstResult(page * pageSize)
.addOrder( Order.asc("nvl(preferred_name, first_name)") )
.setMaxResults(pageSize)
.list();

Error Message:

10:35:45,637 DEBUG web.servlet.DispatcherServlet | Could not complete request
org.hibernate.QueryException: could not resolve property: nvl(preferred_name, first_name) of: com.test.pojo.EmployeeInfo


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2009 4:35 pm 
Beginner
Beginner

Joined: Wed Apr 18, 2007 6:17 pm
Posts: 49
Location: Dominican Republic
Hello achintya, does your database support the nvl function? if it does you could see the dialect of the database extend it and register the nvl function yourself,

It worked for me a while ago,

regards,


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2009 5:08 pm 
Newbie

Joined: Wed Jan 07, 2009 2:58 pm
Posts: 2
Thaks for the post. I am using oracle 10g database. This DB supports NVL.
I see the same issue with other oracle functions like decode also.

I never used dialect. If possible could you please provide more infomation on registering function or provide the sample code. It would be of great help. Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.