标签:数据 sts asc org man tools etop type 引用
在many-to-one的这端加上属性:not-found=ignore
hibernate many-to-one的属性not-found,用来指定引用的外键不存在时如何处理:
exception(默认)抛出异常
ignore 忽略
注解
@NotFound(action=NotFoundAction.IGNORE)
实列
@ManyToOne(cascade={CascadeType.PERSIST},targetEntity=QeTopic.class)
@JoinColumn(name="topic_id",updatable=false)
@NotFound(action=NotFoundAction.IGNORE)
private QeTopic qeTopic;
配置文件
.在<many-to-one>中设置not-found="ignore"
org.hibernate.ObjectNotFoundException: No row with the given identifier exists
标签:数据 sts asc org man tools etop type 引用
原文地址:https://www.cnblogs.com/cn-chy-com/p/8810374.html