java - ORMLite 存储所有类字段注释

标签 java ormlite

最近使用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/

相关文章:

java - 调用 stopService() 时 Android 服务不会停止

java - 服务正在调用实际的类而不是模拟的类。 Junit4 和 Jmock

java - 完成线程 : should i ignore them?

java - Rest API + Json 响应编码错误(我认为)

java - Android 中 Ormlite 查询需要时间

android - 在 Android 上使用 Ormlite 进行多线程读取的性能

Java多进程并行运行导致打开文件指针异常

java - ORMLite - 连接 where 子句中的括号

java - 基本的 ORMLite 数据库问题

java - 在 Android 版 ORMLite 中加入类会引发 SQL 异常 : could not find a foreign class or vice versa