Questions tagged [objectbox]

ObjectBox is an object-oriented embedded database and a full alternative for SQLite, developed by Greenrobot. It supports Android and plain-Java.

ObjectBox is an robust object-oriented embedded database and a full alternative for SQLite. It supports Android, iOS, Linux, macOS, Windows and languages like Java, Kotlin, Swift, C, C++, and Go.

372 questions
8
votes
1 answer

ObjectBox - Database Backup/Restore

I have gone through the documentation and code for sample app, and figured out that files/objectbox/objectbox/data.mdb is the default file where all data is stored. Assuming my understanding is correct, I have a couple of questions that I couldn't…
Ayejay
  • 83
  • 3
6
votes
0 answers

Can't test with coverage in Android Studio and ObjectBox bacause of "cannot find symbol" compilation errors in auto-generated files

I'm using Android studio 4.1.1, ObjectBox 3.0.1 and Kotlin 1.5.10. The tests run nicely when I hit the run button on the test class or run ./gradlew :app-core:test, but when I click on Run X with coverage the tests run through, I'm shown Project Is…
6
votes
1 answer

How to pre-populate data to table?

Recently I have found the article about Room db and there was first tip for pre-populating the data to database. Is there currently some elegant way to pre-populate the data when the database is created? I am using Dagger2, so the actual creation of…
aleksandrbel
  • 1,422
  • 3
  • 20
  • 38
6
votes
4 answers

MyObjectBox is not generated in kotlin (objectbox library)

I am trying to use Object Library. I read the official documentation and follow the instructions. But still, it not working. The problem is when I try to initialize boxStore object I don't find MyObjectBox class. val boxStore =…
Shudipto Trafder
  • 1,932
  • 1
  • 14
  • 27
5
votes
1 answer

Getting error while adding entity in flutter project

I had added multiple entities in object box and successfully build the build_runner. flutter pun run build_runner build. Now, I am adding two more entities but I am getting this error - could not resolve annotation @Entity() Trying to add…
raphire
  • 198
  • 9
5
votes
3 answers

Inserting only unique values in objectbox entity

Is there something similar to this: @Insert(onConflict = OnConflictStrategy.REPLACE) as found in Room database that you can do in Objectbox. If not, how can you avoid saving duplicate entries in an objectbox entity? Thanks.
5
votes
2 answers

How to get distinct values from BoxStore Objectbox database in android

I cant able to write a query to get distinct values in green dao's Objectbox database in android
Anil Kumar GN
  • 339
  • 1
  • 8
4
votes
1 answer

(ObjectBox | Dart) How to pass json to entity class?

The JSON is: { "name": "Leanne Graham", "username": "Bret", "email": "Sincere@april.biz", "address": { "street": "Kulas Light", "suite": "Apt. 556", "city": "Gwenborough", "zipcode": "92998-3874", "geo":…
4
votes
1 answer

ObjectBox ToOne object is null inside entity only on Android Local Unit Testing

I'm trying to write a test for one of my repositories, but I' can't save my Entity object due to the following error: java.lang.IllegalStateException: ToOne object is null inside br.com.CalendarEvent My Entities are these two: @Entity data class…
julioribeiro
  • 1,565
  • 2
  • 14
  • 22
4
votes
3 answers

ObjectBox - Another BoxStore is still open for this directory

So I am using ObjectBox with a library called LibGDX, which is a cross platform gaming library written in java. It works by loading what is like a Java applet inside a single Android Activity class, but all the work is done in the applet, and none…
Russ Wheeler
  • 2,590
  • 5
  • 30
  • 57
4
votes
1 answer

ObjectBox crash - java.lang.IllegalStateException ToOne object is null

I've got 2 objects with the parent holding a list of children: @Entity public class Parent { @Backlink public ToMany children; ... } and @Entity public class Child { ToOne parent; ... } Then I call size() on…
Y. Adler
  • 41
  • 2
4
votes
1 answer

How can I use ObjectBox to store money values (BigDecimal)?

To represent money value I use BigDecimal because of the accuracy (double type causes errors). So, how can I store BigDecimal value in the ObjectBox, what type of a field or converter should I use?
Roman
  • 502
  • 7
  • 17
3
votes
0 answers

Unable to build project for iOS

Just ran into this problem today using v1.30 and I'm out of ideas on what else to apply. Funny enough, I can run a debug build on an iOS device and it builds and runs correctly, but attempting to run on a simulator, or build the project in Xcode…
Swisscheese
  • 571
  • 1
  • 5
  • 21
3
votes
1 answer

How to store a list of maps in ObjectBox box?

I'm trying to store a list of Maps in the ObjectBox box, but since I'm new to ObjectBox I don't understand how to store custom data types. The data I'm trying to store (Structure looks like this) name: 'name', total: 100, refNo: 00, listOfProds:…
Pranav
  • 411
  • 6
  • 19
3
votes
1 answer

objectbox DbMaxReadersExceededException

ObjectBox version 2.7.1, MaxNumReaders 500, @Entity count over 50, Some entities has over 100K rows. Two weeks after release, we started getting errors in Sentry: Could not begin read transaction (maximum of read transactions reached) How to…
1
2 3
24 25