Skip to content

Instantly share code, notes, and snippets.

@wightwulf1944
Created March 11, 2018 11:51
Show Gist options
  • Save wightwulf1944/746951dbdb0e9bf3fa82379af484b035 to your computer and use it in GitHub Desktop.
Save wightwulf1944/746951dbdb0e9bf3fa82379af484b035 to your computer and use it in GitHub Desktop.
public class FooDAO implements Closeable {
private final Realm realm = Realm.getDefaultInstance();
@Override
public void close() {
realm.close();
}
public void setFooValue(RealmFoo foo, String value) {
realm.beginTransaction();
foo.setTrivialValue(value);
realm.commitTransaction();
}
public class RealmFoo extends RealmObject {
private String trivialValue;
public String getTrivialValue() {
return trivialValue;
}
public void setTrivialValue(String value) {
trivialValue = value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment