简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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