-->
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: How to implement nvl in Hibernate Query?
PostPosted: Wed Nov 09, 2005 1:31 pm 
Newbie

Joined: Mon Nov 07, 2005 2:43 am
Posts: 5
Hi,
I'm facing a peculiar issue where in I have to query with a constraint on a nullable field. say something like
select * from soldto soldto where nvl(soldto.rowstate,0) != 2000. Is there a way, I can implement this in Hibernate? Or do I have to resort to native SQL?

Thanks for your Help
Dheepak.


Top
 Profile  
 
 Post subject: sql
PostPosted: Wed Nov 09, 2005 2:43 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
I think you neet to resort to SQL queries:
http://www.hibernate.org/hib_docs/v3/re ... -nativesql

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 28, 2007 11:41 am 
Beginner
Beginner

Joined: Wed Sep 06, 2006 12:08 pm
Posts: 48
Location: Warsaw - Poland - Europe - Milky Way
Hi

You can use coalesce Hibernate function.

Example:
COALESCE(soldto.rowstate,0) != 2000

Regards,
Adam Woźniak

PS. rate if helps.


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.