Search in sources :

Example 1 with AndrormField

use of com.orm.androrm.field.AndrormField in project androrm by androrm.

the class Model method resetFields.

private <T extends Model> boolean resetFields() {
    List<Field> fields = DatabaseBuilder.getFields(getClass(), this);
    try {
        for (Field field : fields) {
            Object o = field.get(this);
            if (o instanceof AndrormField) {
                AndrormField f = (AndrormField) o;
                f.reset();
            }
        }
        return true;
    } catch (IllegalAccessException e) {
        return false;
    }
}
Also used : ManyToManyField(com.orm.androrm.field.ManyToManyField) OneToManyField(com.orm.androrm.field.OneToManyField) ForeignKeyField(com.orm.androrm.field.ForeignKeyField) Field(java.lang.reflect.Field) IntegerField(com.orm.androrm.field.IntegerField) DataField(com.orm.androrm.field.DataField) AndrormField(com.orm.androrm.field.AndrormField) AndrormField(com.orm.androrm.field.AndrormField)

Aggregations

AndrormField (com.orm.androrm.field.AndrormField)1 DataField (com.orm.androrm.field.DataField)1 ForeignKeyField (com.orm.androrm.field.ForeignKeyField)1 IntegerField (com.orm.androrm.field.IntegerField)1 ManyToManyField (com.orm.androrm.field.ManyToManyField)1 OneToManyField (com.orm.androrm.field.OneToManyField)1 Field (java.lang.reflect.Field)1