1

im trying to create an objectbox for class but i don't need to save all values of that specific class. part of the values i use only at run-time so there is not point to save them in the database

iv tried to search over your site but couldn't find any documentation about excluding values

im using android and kotlin

for example:

class Timer(var total : Long) {
    //i dont need to save it. use it for runtime only
    var elapsedTime: Long = 0
}

1 Answer 1

3

To exclude properties use @Transient (from Kotlin or ObjectBox, both should work).

3
  • hi i just tried it and its not working every time i set my var as @Transient i cant find MyObjectBox anymore
    – CodePLeX
    Sep 16, 2017 at 14:03
  • now i have a different problem every time im trying to rebuild my project if im not removing all references of MyObjectBox after rebuild i get an error cant find MyObjectBox i get the same error with Entity_ class so i cant use ObjectBox :(
    – CodePLeX
    Sep 16, 2017 at 17:23
  • MyObjectBox is generated during the build. Do you have other build problems before that? Sep 16, 2017 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.