Created
March 11, 2018 11:51
-
-
Save wightwulf1944/746951dbdb0e9bf3fa82379af484b035 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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