我一直在探索Room个数据库对象映射库,我发现了一些奇怪的事情.
正如this答案所示,实体数据模型不能具有不变的属性.
但我也判断了google's persistent example with kotlinRoom
个具有不可变属性的作品.请判断示例中的this数据类.
这种行为的原因可能是什么?
This could be a good feature if we could create immutable values (val
properties), as this restrict programmers from changing unique identifiers such as ids after an object has been created.