最近使用ORMLite,发现ORMLite的@DatabaseField
注解有persisted
值
(link)。
Set this to be false (default true) to not store this field in the database. This is useful if you want to have the annotation on all of your fields but turn off the writing of some of them to the database.
该文档说明表明有一种方法可以在所有类字段上进行注释。 ORMLite 是否有提供“存储所有字段”功能的注释? 或者还有另一种方法可以做到这一点,而不是将 @DatabaseField 添加到类中的每个字段。
最佳答案
Does ORMLite have any annotation which provides 'store all fields' feature? Or there is another way to do that instead adding @DatabaseField to every field in class.
抱歉,但事实并非如此。无法使用注释来保留所有字段。还有其他方法configure a class在 ORMLite 中,但没有一个会自动添加有关所有字段的详细信息。
关于java - ORMLite 存储所有类字段注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43244189/