@OneToMany注解的使用 实现一对多级联操作
主表类
@OneToMany(mappedBy = "contentApply",cascade = {CascadeType.ALL})
@JsonIgnoreProperties(value = { "contentApply" }, allowSetters = true)
private Set<ContentApplyRelateData> relateData = new HashSet<>();
子表类
@Size(max = 32)
@Column(name = "content_apply_code", length = 32,insertable = false,updatable = false)
private String contentApplyCode;
@ManyToOne
@JsonIgnoreProperties(value = { "relateData" }, allowSetters = false)
@JoinColumn(name = "content_apply_code(此字段为子表内外键也就是关联主表的字段)")
private ContentApply contentApply;