The class javax.persistence.ForeignKey contains the following code:
@Target({}) @Retention(RUNTIME) public @interface ForeignKey {
In other words: It specifies no targets. Consequently, it isn't possible to use the annotation at all. The correct code would be:
@Target( {FIELD, METHOD, TYPE}
) @Retention(RUNTIME) public @interface ForeignKey {
(Copied from org.hibernate.annotations.ForeignKey.)
Workaround: Use the deprecated org.hibernate.annotations.ForeignKey.)
|