更新时间:2023-01-08 18:44:28
消息非常清晰.您是对JPA说的:这个OneToMany是Delivery
实体中通过字段deliveries
定义的ManyToOne的反面.但是Delivery
中没有字段deliveries
.交付中的相应字段名为purveyor
:
The message is pretty clear. You're saying to JPA: this OneToMany is the inverse side of the ManyToOne, defined in the Delivery
entity, by the field deliveries
. But there is no field deliveries
in Delivery
. The corresponding field in Delivery is named purveyor
:
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name = "ref_purveyor")
private Purveyor purveyor;
^-- this is the other side of the association
所以您需要的是
@OneToMany(fetch=FetchType.LAZY,mappedBy = "puveyor")