The .name() change from toString() was a good one, but there's a missing
case.. NullSafeSet should look like:
public void nullSafeSet(PreparedStatement preparedStatement, Object
value, int index)
throws HibernateException, SQLException {
if (null == value) {
preparedStatement.setNull(index, Types.VARCHAR);
} else {
preparedStatement.setString(index, ((Enum)value).name());
}
} |