( Context context, Class<T> clazz )
| 479 | } |
| 480 | |
| 481 | private <T extends Model, O extends Model> void persistRelations( |
| 482 | |
| 483 | Context context, |
| 484 | Class<T> clazz |
| 485 | |
| 486 | ) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException { |
| 487 | |
| 488 | if(clazz != null && clazz.isInstance(this)) { |
| 489 | |
| 490 | for(Field field: DatabaseBuilder.getFields(clazz, this)) { |
| 491 | Object o = field.get(this); |
| 492 | |
| 493 | if(o instanceof ManyToManyField) { |
| 494 | saveM2MToDatabase(context, clazz, o); |
| 495 | } |
| 496 | |
| 497 | if(o instanceof OneToManyField) { |
| 498 | saveO2MToDatabase(context, o); |
| 499 | } |
| 500 | } |
| 501 | |
| 502 | persistRelations(context, getSuperclass(clazz)); |
| 503 | } |
| 504 | } |
| 505 | |
| 506 | private void putValue( |
| 507 |
no test coverage detected