-
Dec 16th, 2005, 04:27 PM
#1
HibernateTemplate.find(queryString, value,type) removed in Hibernate3?
Hello,
I am in the process of upgrading to Hibernate3 and changing all our dao classes to use org.springframework.orm.hibernate3. I have found that all the Hibertemplate.find signatures that had 3 parameters :
List find(final String queryString, final Object[] values, final Type[] types),
List find(String queryString, Object value, Type type) etc. were removed.
At first this seemed like a small migration issue which required simply running a search and replace to remove the type parameter from all the method calls. As I began testing, I found a bigger issue. When using the find method with 3 parameters, if any of the parameters passed to a dao method were unexpectedly a null value, the dao method would return an empty list. Now that hibernate has to determine the type, a null passed into a method has dire consequences and exceptions such as these are thrown:
Dec 16, 2005 3:52:19 PM org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 932, SQLState: 42000
Dec 16, 2005 3:52:19 PM org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: ORA-00932: inconsistent datatypes: expected NUMBER got BINARY
I know that one obvious and simple solution will be to go through all the dao code and ensure that it is checking for nulls. However, I'm wondering why these signatures were removed from this version and if there is any plan to add them back?
Thank you very much.
Ursula
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules