Hibernate v 3.0 rc1
DB2 8.1
I have the following query which does not work:
String querySelect = "from Product as product "
+ "where lower(product.name)=lower(:name)";
However, the following works:
+ "where lower(product.name)=:name";
Something to do the lower call. Any ideas. TIA.
DEBUG QueryTranslatorImpl:177 - HQL: from test.hibernate.Product as product where lower(product.name)=lower(:name)
DEBUG QueryTranslatorImpl:178 - SQL: select product0_.id as id, product0_.name as name2_, product0_.price as price2_, product0_.amount as amount2_ from DB2ADMIN.products product0_ where (lower(product0_.name)=lower(?))
DEBUG AbstractBatcher:258 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
DEBUG AbstractBatcher:379 - opening JDBC connection
DEBUG DriverManagerConnectionProvider:93 - total checked-out connections: 0
DEBUG DriverManagerConnectionProvider:99 - using pooled JDBC connection, pool size: 0
DEBUG SQL:292 - select product0_.id as id, product0_.name as name2_, product0_.price as price2_, product0_.amount as amount2_ from DB2ADMIN.products product0_ where (lower(product0_.name)=lower(?))
Hibernate: select product0_.id as id, product0_.name as name2_, product0_.price as price2_, product0_.amount as amount2_ from DB2ADMIN.products product0_ where (lower(product0_.name)=lower(?))
DEBUG AbstractBatcher:343 - preparing statement
DEBUG QueryLoader:228 - bindNamedParameters() coffee -> name [1]
DEBUG AbstractBatcher:266 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG AbstractBatcher:363 - closing statement
DEBUG JDBCExceptionReporter:49 - could not execute query [select product0_.id as id, product0_.name as name2_, product0_.price as price2_, product0_.amount as amount2_ from DB2ADMIN.products product0_ where (lower(product0_.name)=lower(?))]
com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -418, SQLSTATE: 42610, SQLERRMC: null
|