I was trying to use the HibernateTemplate's method createCriteria and found that there's no wrapping for Hibernate's checked exception HibernateException in this method.
Why isn't the exception being converted to a Spring's unchecked exception?
I was trying to use the HibernateTemplate's method createCriteria and found that there's no wrapping for Hibernate's checked exception HibernateException in this method.
Why isn't the exception being converted to a Spring's unchecked exception?
- N!K -
Simply because HibernateException is never thrown in this method body.
If not, why is it declared in the method's signature?
- N!K -
Actually, as the JavaDoc states, you are really expected to use this inside a HibernateCallback (as you get when using the execute method). The execute method will do the exception translating for you.
Colin Sampaleanu
SpringSource - http://www.springsource.com