从指定 class 的对象框中排除变量

exclude vars from objectbox of specified class

我正在尝试为 class 创建对象框,但我不需要保存特定 class 的所有值。 我仅在 运行 时使用的部分值,因此没有必要将它们保存在数据库中

iv 尝试搜索您的网站,但找不到任何关于排除值的文档

我正在使用 android 和 kotlin

例如:

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

要排除属性,请使用 @Transient(来自 Kotlin 或 ObjectBox,两者都应该有效)。