Code example for Field

Methods: getAnnotation, getName

0
        return setMethod;
    } 
 
 
    public static String getColumnNameByField(Field field) {
        Column column = field.getAnnotation(Column.class);
        if (column != null && !TextUtils.isEmpty(column.column())) {
            return column.column();
        } 
 
        Id id = field.getAnnotation(Id.class);
        if (id != null && !TextUtils.isEmpty(id.column())) {
            return id.column();
        } 
 
        Foreign foreign = field.getAnnotation(Foreign.class);
        if (foreign != null && !TextUtils.isEmpty(foreign.column())) {
            return foreign.column();
        } 
 
        Finder finder = field.getAnnotation(Finder.class);
        if (finder != null) {
            return field.getName();
        } 
 
        return field.getName();
    } 
 
    public static String getForeignColumnNameByField(Field field) {
 
        Foreign foreign = field.getAnnotation(Foreign.class);