I am mapping my classes with the tables of my database, but when running a test, I get the following error:
Caused by: org.hibernate.AnnotationException: A F
As of Java 8 (introducing @Repeatable), the wrapper annotation @JoinColumns is no longer required .
So, you can simply do this:
// bi-directional many-to-one association to Provincia
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name = "codProvincia", insertable = false, updatable = false)
@JoinColumn(name = "codRegion", insertable = false, updatable = false)
private Provincia provincia;
References:
Java 8's new Type Annotations
Repeating Annotations