Code example for ResultSet

Methods: getString, wasNull

0
        return false; 
    } 
 
    public Object nullSafeGet(ResultSet rs, String[] names, Object owner)
            throws HibernateException, SQLException { 
        String name = rs.getString(names[0]);
        return rs.wasNull() ? null : Enum.valueOf(enumClass, name);
    } 
 
    public void nullSafeSet(PreparedStatement st, Object value, int index)
            throws HibernateException, SQLException { 
        if (value == null) {
            st.setNull(index, Types.VARCHAR);
        } else { 
            st.setString(index, ((Enum) value).name());
        } 
    } 
 
    public Object replace(Object original, Object target, Object owner) throws HibernateException {
        return original;
    }