我在两个实体Equipement和DemandeDI之间有一个双向关系,我想在DemandeDI中添加一个带有休息服务的行(Angular 5),但我发生了这个错误
请注意,当我手动添加存储库或行时,问题不会出现
使用RestController类的高级rest客户端。
设备实体
@JsonIdentityInfo(generator =
ObjectIdGenerators.PropertyGenerator.class,property = "id" ,
scope = Equipement.class)
@Entity
public class Equipement implements Serializable {
@Id
@GeneratedValue
private Long id;
@Column(unique=true,nullable = false)
private String reference;
@OneToMany( mappedBy = "equipement" , cascade = CascadeType.REMOVE)
private Collection<DemandeDI> demandeDIS;
}
DemandeDI实体
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class,property = "id",
scope = DemandeDI.class)
@Entity
public class DemandeDI implements Serializable {
@Id
@GeneratedValue
private Long id;
@Column(nullable = false)
private String description;
@CreatedDate
@Temporal(TIMESTAMP)
private Date dateDI;
private String etat;
@ManyToOne
@JoinColumn(name = "equipement")
private Equipement equipement;
}
我总是捕捉错误并在swal窗口中显示它们 here is the message error