mappers (i.e. Room, GreenDAO) – Need to write SQL for every request – No auto-completion, no type safety – Migrations are scary – Realm – Complex – Inheritance-based – Custom types (e.g. JodaTime) suck – Weird threading requirements – Migrations are scary
– No need to write SQL – Super fast – Great Kotlin support – RxJava 2 support – Annotation-based – Easy to learn – Safe, easy migrations – Web-based data browser – Local unit tests
– No need to write SQL – Super fast – Great Kotlin support – RxJava 2 support – Annotation-based – Easy to learn – Safe, easy migrations – Web-based data browser – Local unit tests
to provide ObjectBox either an empty constructor or an all-args one. Otherwise your queries will fail silently because ObjectBox cannot set the ID of your entities.
also use ObjectBox’s own data observers put() will update an object if the ID is already in the database. Your objects aren’t “live” like in Realm. Your changes need to be persisted with put()
normal List and track changes yourself) – Tracks changes to be persisted (using put()) – Use with @Backlink annotation to link with a ToOne<T> property and create a One-To-Many relation
For ambiguous schema modifications (i.e. changing the name or type of a property), annotate your entity class with @Uid, build your project and follow the instructions – UIDs are stored in a file called default.json. Make sure to add it to Git.