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

Method get

src/src/com/orm/androrm/field/ForeignKeyField.java:85–91  ·  view source on GitHub ↗

As foreign keys may require database access in order to get their value, you have to use this function. The regular DataField#get() won't work at all times. @param context Context of the application. @return An instance of the references model or null if nothing cou

(Context context)

Source from the content-addressed store, hash-verified

83 * if nothing could be found.
84 */
85 public T get(Context context) {
86 if(mValue == null) {
87 return Model.objects(context, mTarget).get(mReference);
88 }
89
90 return mValue;
91 }
92
93 /**
94 * Creates the foreign key constraint for the database.

Callers 4

testGetDefaulsMethod · 0.95
testSetAndGetMethod · 0.95
testResetMethod · 0.95

Calls 2

objectsMethod · 0.95
getMethod · 0.65

Tested by 4

testGetDefaulsMethod · 0.76
testSetAndGetMethod · 0.76
testResetMethod · 0.76