MCPcopy Create free account
hub / github.com/androrm/androrm / persistRelations

Method persistRelations

src/src/com/orm/androrm/Model.java:481–504  ·  view source on GitHub ↗
(
			
			Context	 context, 
			Class<T> clazz
			
	)

Source from the content-addressed store, hash-verified

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

Callers 1

saveMethod · 0.95

Calls 5

getFieldsMethod · 0.95
saveM2MToDatabaseMethod · 0.95
saveO2MToDatabaseMethod · 0.95
getSuperclassMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected