-->
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.  [ 1 post ] 
Author Message
 Post subject: hibernate and SQLServer function
PostPosted: Wed Aug 23, 2006 7:04 am 
Newbie

Joined: Wed Aug 23, 2006 6:50 am
Posts: 5
Hibernate version:3.1

now I want to use sql's isNull function with hiberante3.1. in Hibernate 2.1 it worked bat in new version don't.
my code is :

String sql="from NetworkUnit n where
(isNull((select sum(tpay.amount) from Transaction tpay where
tpay.companyCustomer.id=n.account.companyCustomer.id and
tpay.operation.type.id=65),0.0)+0.01)<67"

Query q = getSession().createQuery( sql.toString() );
q.list();
during execution of this query hibernate don't anderstand isNull () function and says :
q.list() throws exception that says:
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The isnull function requires 2 arguments.

how can I write correctly this code? enyone can help me?


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

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.