-->
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 null check(NVL) function in HQL?
PostPosted: Sun Mar 11, 2007 1:25 am 
Newbie

Joined: Thu Mar 08, 2007 8:49 am
Posts: 11
Location: Hyd
Hi,

I am using Hibernate3.0. I want to know how to use null check function(NVL). My DB is Oracle 10g.My dialect is "org.hibernate.OracleDialect".

I am using named querys. If i use NVL function directly, when Null value is going for Long or Integer I got error like "can't assign Binary value to Integer".

In search condition if i have three fields they may be null, Now i am writting eight querys for each possible condition.

Pls Help.

_________________
Thanks&Regards
Sunil k


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 28, 2007 11:37 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:
SELECT
COALESCE(bscserappc0_.BSCS_CONTRACT_ID,12) AS col_0_0_
FROM
AERAPP_CONTRACTS bscserappc0_

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.  [ 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.