objectbox-examples
objectbox-examples copied to clipboard
ObjectBox DaoCompat
I want to migrate your existing greenDAO data to ObjectBox.
// note example
List<com.example.app.daos.greendao.Note> notes = daoSession.getNoteDao().loadAll();
List<Note> convertedNotes = convertToObjectBoxNotes(notes);
daoCompatSession.getNoteDao().insertInTx(convertedNotes);
GreenDao is promoted to ObjectBox, I don’t know how to convert ‘converttoObjectBoxnotes’. Can you provide a specific instance?
Hi, sorry for seeing this so late (we typically track issues at https://github.com/objectbox/objectbox-java).
Did you figure this out? Basically you need to map your DAO object to an ObjectBox object. It's up to your code on how to do this.
In that case you also might want to use the ObjectBox Store and Box APIs directly instead of going through the DAOcompat APIs.