Is @Inheritance
, @DiscriminatorValue
, @DiscriminatorColumn
applicable to @MappedSuperClass
?
Question is asked because In ORM.XML JPA Specification Entity have attribute :
"inheritance",
"discriminatorValue",
"discriminatorColumn",
but MappedSuperclass does not have .
No, they're not applicable. MappedSuperclass
is used for code reuse, and not for entity inheritance. It's only used to share common properties and methods between entities that have, otherwise, nothing in common.
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.