对实体类做映射时
@ManyToOne
@JoinColumn(name="customer_id")
private Customer customer;
@ManyToOne
@JoinColumn(name="customer_id", referencedColumnName = "customer_id")
private CustomerAuthentication customerAuthentication;
会报下面的异常信息,customer_id被重复使用
Repeated column in mapping for entity: xx.xx column:
customer_id (should be mapped with insert="false" update="false")
改成下面的这种形式就可以了。
@ManyToOne
@JoinColumn(name="customer_id")
private Customer customer;
@ManyToOne
@JoinColumn(name="customer_id", referencedColumnName = "customer_id", insertable = false, updatable = false)
private CustomerAuthentication customerAuthentication;