开发者

Can you specialize inherited Java annotations

开发者 https://www.devze.com 2022-12-18 18:14 出处:网络
I have an abstract superclass that has JPA annotations on it mapping some of its fields.The class itself has the @MappedSuperclass annotation.

I have an abstract superclass that has JPA annotations on it mapping some of its fields. The class itself has the @MappedSuperclass annotation.

Can I specialize/add or change just one element of an inhe开发者_开发百科rited annotation without re-specifying the entire annotation?


The only thing you can do with Annotations is to place an Annotation on an Annotation and have a library which understands this as a form of inheritance.

The problem is that if you re-specify the entire annotation, any library which expects MappedSuperclass will ignore it.

0

精彩评论

暂无评论...
验证码 换一张
取 消