加载中...
加载中...
org.hibernate.ObjectNotFoundException: No row with the given

org.hibernate.ObjectNotFoundException: No row with the given 原创

hibernate项目里面配many-to-one的关联,数据库不存在某数据,就会抛异常

org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.skysz.app.pay.domain.PayBill#526504]

解决方法

<many-to-one not-found="ignore" name="payBill" column="payBillID_" class="com.skysz.app.pay.domain.PayBill" lazy="false"/>


hibernate many-to-one的属性not-found,用来指定引用的外键不存在时如何处理:
exception(默认)抛出异常
ignore 忽略

没有更多推荐了 [去首页]
image
文章
357
原创
284
转载
73
翻译
0
访问量
199056
喜欢
47
粉丝
6
码龄
5年
资源
0

文章目录

加载中...
0
0