yong.wang wrote:
> Mark,
>
> The problem we have with 3.1.x connectors and
> hibernate:
>
> We have a field defined as follows:
>
> IS_DEMO char default 0 NULL
>
> And the all records has 0 for this field. But
> hibernate is giving this exception:
[snip]
Yong,
I'd have to see the query that Hibernate is generating and the data for the table in question, however it looks like you have a programming error. What is the _java_ field type for isDemo? If it's a primitive (such as boolean), you can't have NULL assigned to it.
I'm not sure why this would work with Connector/J 3.0.x but not Connector/J 3.1.x, except that Connector/J 3.0.x would return '0' for _empty_ (not NULL_) fields by default, and Connector/J 3.1.x doesn't (but throws an exception, so my guess is that's not the problem here). Maybe there was a bug in Connector/J 3.0 that caused ResultSet.wasNull() to not be accurate in your case, and it's fixed in Connector/J 3.1?
-Mark
Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html