我有以下實體 @Entity
@Table(name = "Example")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
public class Example implements Comparable<Example>,
我現在有其中父實體知道它的孩子,像這樣的關係: @Entity
public class Parent{
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
@JoinColumn
private Set<Child> children = new