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 忽略