Code example for Field

Methods: get, getAnnotation, getName, setAccessible

0
    } 
 
    @Override 
    public void modelToDatabase(Field field, Object instance, ContentValues values)
    { 
        field.setAccessible(true);
        try 
        { 
            Object value = field.get(instance);
            if (value != null)
            { 
                Column column = field.getAnnotation(Column.class);
                values.put(column.value(), value.toString());
            } 
        } 
        catch (IllegalAccessException e)
        { 
            throw new DataAccessException("Unable to get the Column value from the domain object: " + instance.getClass().getName() + " for Field: "
                    + field.getName());
        } 
 
    } 
 
    /**