如何@Ignore Room 库中的受保护字段

How to @Ignore protected fields in Room library

房间出错:

someField has protected access in LibraryClass

我无权访问该字段,因为它在图书馆中。我怎样才能强制 Room 不保存这个字段(因为我不需要它)?

How can I force Room to not save this field

不要继承 class。让 @Entity 从您无法控制的某些 class 继承是相当冒险的,这就是您将遇到的问题。让您的 @Entity 成为一个简单的 POJO。