Hi,
I have a problem with a HQL query:
Query q = session.createQuery("select l1_1.id, l1_1.name from Location as l1_1 where (l1_1.id = :ID) ");
q.setParameter("ID", locationID);
locationID is an Integer variable.
If locationID <> null the query works fine, but if it is null I get the following error:
11:18:15,538 WARN JDBCExceptionReporter:57 - SQL Error: 932, SQLState: HY000
11:18:15,538 ERROR JDBCExceptionReporter:58 - [Oracle JDBC Driver][Oracle]ORA-00932: inconsistent datatypes: expected NUMBER got BINARY
This is the generated sql :
select location0_.id as x0_0_, location0_.name as x1_0_ from core_location location0_ where ((location0_.id=? ))
I'm using:
Hibernate 2.1.7.
Oracle 9
Tomcat 5.5
Many thanks,
Vasile
|