Open
Description
Is there an existing issue?
- I have searched existing issues
Use case
I am storing a mapping:
val mapping = mutableMapOf(
"key1" to mutableMapOf(
"subkey1" to 1L,
"subkey2" to 1L,
"subkey3" to 1L
),
"key2" to 1L
that is represented in the data class
as follows:
@Entity
data class MyDataClass(
@Id var id: Long = 0,
var mapping: MutableMap<String, Any>? = null
ObjectBox will store the Long values as Ints due to not being wide enough. These breaks use cases where we do want to store the Long values as Long and not as Ints (for example test cases that use the same generated mock data to store in the database and to test against).
Proposed solution
Have an annotation that tells ObjectBox to store Long values as Long.
Alternatives
Tried using a PropertyConverter
however this breaks for the mapping I've provided.
Additional context
Kotlin
Android