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. |