@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", unique = true, nullable = false)
private Integer id;
@JsonIgnore
@ManyToOne
@JoinColumn(name="pid")
private ConfigBean parent;
@OrderBy("sort asc,id asc")
@OneToMany(fetch = FetchType.LAZY,cascade = CascadeType.ALL,mappedBy = "parent")
private List<ConfigBean> childrens = new ArrayList<ConfigBean>(0);
单表的一对多多对一的自关联配置
最新推荐文章于 2024-04-28 13:06:51 发布