Code example for ResultSet

Methods: getDouble, wasNull

0
    } 
 
    public Object nullSafeGet(ResultSet rs, String[] names, Object owner)
            throws HibernateException, SQLException { 
 
        double min = rs.getDouble(names[0]);
        if(min==0 && rs.wasNull())
            min = Double.NaN;
        double max = rs.getDouble(names[1]);
        if(max==0 && rs.wasNull())
            max = Double.NaN;
 
        if(Double.isNaN(min) && Double.isNaN(max))
            return null; 
        else 
            return NumberRange.create(min, max);
    } 
 
    public void nullSafeSet(PreparedStatement st, Object value, int index)
            throws HibernateException, SQLException {