简体   繁体   English

在休眠状态仅持久化基类的字段

[英]Persist only base class's fields at hibernate

I have a base class and some class which extends the base class. 我有一个基类和一些扩展基类的类。 Due to the fields of the extending class used for other purpose and for the db, I want to persist only the base class field, how can I do it? 由于扩展类的字段用于其他目的和数据库,我只想保留基类字段,我该怎么做? Is there an annotation that do it? 有做的注释吗?
Note that I don't want to use @Transient for each new field I crate. 请注意,我不想对创建的每个新字段使用@Transient。

如果只想保留基类对象,则只需创建基类实体而不是子类实体并保存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM