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

Method buildJoin

src/src/com/orm/androrm/QueryBuilder.java:49–73  ·  view source on GitHub ↗
(
			
			Class<T> 		clazz,
			List<String> 	fields, 
			Rule 			filter, 
			int 			depth
			
	)

Source from the content-addressed store, hash-verified

47 private static final String TAG = "ANDRORM:QUERY:BUILDER";
48
49 private static final <T extends Model> SelectStatement buildJoin(
50
51 Class<T> clazz,
52 List<String> fields,
53 Rule filter,
54 int depth
55
56 ) {
57
58 T instance = Model.getInstace(clazz);
59
60 if(instance != null) {
61 Object fieldInstance = getFieldInstance(clazz, instance, fields.get(0));
62
63 if(fields.size() == 1) {
64 return resolveLastField(fieldInstance, clazz, filter);
65 }
66
67 if(DatabaseBuilder.isRelationalField(fieldInstance)) {
68 return resolveRelationField(fieldInstance, clazz, fields, filter, depth);
69 }
70 }
71
72 return null;
73 }
74
75 public static final <T extends Model> SelectStatement buildQuery(
76

Callers 2

buildQueryMethod · 0.95
resolveRelationFieldMethod · 0.95

Calls 6

getInstaceMethod · 0.95
getFieldInstanceMethod · 0.95
resolveLastFieldMethod · 0.95
isRelationalFieldMethod · 0.95
resolveRelationFieldMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected