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?
|
|