Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObjectBox DaoCompat #59

Open
wangwei66666 opened this issue Aug 31, 2022 · 1 comment
Open

ObjectBox DaoCompat #59

wangwei66666 opened this issue Aug 31, 2022 · 1 comment

Comments

@wangwei66666
Copy link

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?

@greenrobot-team
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants