For sake of performace this method should be slightly modified:
[code]
public Object nullSafeGet(ResultSet resultSet, String[] names,
Object owner) throws HibernateException, SQLException {
String name = resultSet.getString(names[0]);
E result = null;
if (!resultSet.wasNull()) {
result = Enum.valueOf(clazz, name);
}
return result;
}
[/code]
to
[code]
public Object nullSafeGet(ResultSet resultSet, String[] names,
Object owner) throws HibernateException, SQLException {
E result = null;
if (!resultSet.wasNull()) {
String name = resultSet.getString(names[0]);
result = Enum.valueOf(clazz, name);
}
return result;
}
[/code] |