net.sf.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type

Posted by lot on Stack Overflow See other posts from Stack Overflow or by lot
Published on 2011-02-11T07:20:53Z Indexed on 2011/02/11 7:25 UTC
Read the original article Hit count: 254

Filed under:

Hi!

What might be reasons for running in the quoted exception upon a HQL select, when there is actually no NULL value in the respective field in the database?

I've checked the database multiple times. I've manually submitted the query statement produced by hibernate (extracted from debug). Null values for the respective field are actually never returned. However, the corresponding row in the database is in fact nullable. Does hibernate care about the data base definition?

I know, I could simple change the filed to a wrapper type, but we have a number of such fields in a legacy application and this only occurs upon a single query. I'm just wondering about the actual reason for getting this exception only with a single property. Any hints would be greatly appreciated.

© Stack Overflow or respective owner

Related posts about hibernate