Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 db4o 作为 DBMS,我有一个问题:
有什么方法可以指定我不想将模型类中的字段存储在数据库中?
@Transient使用关系数据库时类似于注释的东西?
@Transient
只需使用 Java 内置的瞬态标记:
private transient String myField;
还是有什么特殊原因不能使用?
DB4O 也不会自动持久化静态 Java 字段:
http://community.versant.com/documentation/reference/db4o-8.1/java/reference/Content/advanced_topics/type_handling/static_fields_and_enums/static_fields_api.htm