-->
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: Using Decode in HQL
PostPosted: Mon Mar 30, 2009 1:15 pm 
Newbie

Joined: Tue Mar 10, 2009 10:48 pm
Posts: 18
Hi,

I am having errors when using select decode in my HQL createQuery.
Does it support?? What is the workaround??? I cant use native SQL for my project. How?? I am totally lost.

Appreciate any kinds of help!
Thanks in advance!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 31, 2009 1:37 pm 
Senior
Senior

Joined: Tue Aug 01, 2006 9:24 pm
Posts: 120
Decode is not a function readily available on most databases, actually to my knowledge it's oracle specific. If you are using a database specific command then your not really database agnostic anyway. Which is why there is not a similar hql function for this.

http://forum.hibernate.org/viewtopic.ph ... 348dfc83f3


There is a way to do this with formula's but I have never done it myself. Take a look at these links
http://forum.springsource.org/showthread.php?t=32177

http://www.onjava.com/pub/a/onjava/2005 ... rnate.html

http://www.hibernate.org/hib_docs/v3/ap ... rmula.html

hope this helps

_________________
Please rate my replies as I need points for all of my questions also.


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.