<span style="white-space:pre"> </span>/** 关联策略渠道 */
@OneToMany(mappedBy = "rule", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
@OrderBy("channel")
private List<PolicyChannel> channels = new ArrayList<PolicyChannel>();
/** 关联规则 */
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "ruleId")
private PolicyRule rule;
1.在删除子表中数据时,加上orphanRemoval 注解,方可删除。
Hibernate使用相关点
最新推荐文章于 2024-08-05 11:05:53 发布