Closed DJafari closed 2 years ago
Theoretically yes, but we have not tested this. The model must match exactly (e.g. check that the model JSON files are identical) and the database must use the same directory. To avoid threading issues the code probably should create the store read-only (there can only be one write transaction at all times).
What's your use case here? Why can't the Dart code read/work with the database? Might using a platform channel be an option?
because i have a foreground service and i want read / update my box in background, we must do it in native and can't done in dart
i think big problem is linking objectbox-model.json
to the one file, is possilbe change default address of objectbox-model.json
in java/kotlin ?
is possible make a sample for that?
thanks
Thanks for the details.
i think big problem is linking objectbox-model.json to the one file
It's fine to have two files. They are based on the annotated classes in each language anyhow. Maybe to clarify: you have to re-create the complete data model (all Dart classes annotated with @Entity
) in Java/Kotlin for this to work.
imagine we are create a project with objectbox-dart in flutter
we want read all box of store in native plugin ( for example in android platform ), is possible this ?
if we define models in java / kotlin, are we can to read it ?