Есть класс User
@Entity
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer userId;
@OneToMany(mappedBy = "creator")
Set<Proposal> creatorsProposal;
@OneToMany(mappedBy = "performer")
Set<Proposal> performersProposal;
}
И класс Proposal
@Entity
@Table(name = "proposals")
public class Proposal {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
@ManyToOne
@JoinColumn(name = "userId")
@NotNull
private User creator;
@ManyToOne
@JoinColumn(name = "userId")
private User performer;
Получаю следующую ошибку
Repeated column in mapping for entity: Proposal column: user_id (should be mapped with insert="false" update="false")
Как правильно сделать mapping для этой схемы?