The {{@Target}} annotation is not needed on associations, because the JPA mapping annotations let you specify a {{target}} member.
The only possible usecase I can see for it is if you have an {{@Embeddable}} which implements an interface and you don’t want to write your code around the concrete class but … cmon, it’s not _really_ polymorphic. And once you go and stick {{@Embeddable}} on it, you’ve tied your code to the concrete class _anyway_, just as much as if you had put the concrete class in the type declaration instead of in an annotation.
So I say we deprecate this.
The {{@Proxy}} annotation could, in principle, be useful, but I’m struggling to see how it’s supposed to be used in its current form. It feels like it would be more useful if it specified a list of proxied types, or perhaps if it were inverted so that you could _exclude_ a type from the proxied types. Even then, I just struggle to see that anyone has a real need for this today. I think we can deprecate it for now, and if someone complains then we will get a chance to explore what their real use case is and how it’s best solved.
The {{@Polymorphism}} annotation just doesn’t seem useful. Worse, it’s very confusing to users, who always think it means something else. It’s also badly-designed. (It would be better if it were just a {{@ImplicitPolymorphismDisabled}} annotation with no members. So lets deprecate this one too. |
|