I have two tables with foreign key relations. I\'ve tried searching on how to do it and it always leads to OneToMany & ManyToOne mapping. I have these two tables.
<
Can you move the relationship to a related object like this
@ManyToOne()
@JoinColumn(name="role_id", referencedColumnName = "role_id", insertable = false, updatable = false)
private UserRole userRole;
and same do for userRole
@OneToMany(targetEntity=User.class, mappedBy="userRole",cascade=CascadeType.ALL, fetch = FetchType.LAZY)
private List user = new ArrayList<>();
Update
The jar file seems to be corrupted. Try removing the content from the .m2\repository and mvn clean install
OR
Right-click your project, select Maven, Update Project, check on Force Update of Snapshots/Releases.