Hibernate异常No row with the given identifier exists 解决方法
这个异常是在 多对一关系映射时,一方表中对应的数据不存在才抛出的。
原来的配置:
<many-to-on
这个异常是在 多对一关系映射时,一方表中对应的数据不存在才抛出的。
原来的配置:
<many-to-on
<wbr>e class="com.art.model.user.UserInfo" fetch="join" name="userInfo" ><br> <column name="userId" unique="true"/><br></many-to-on<wbr>e><br><br>修改后的:<br><many-to-on<wbr>e class="com.art.model.user.UserInfo" fetch="join" name="userInfo"<span style="color:#ff00;"> not-found="ignore"</span>><br> <column name="userId" unique="true"/><br></many-to-on<wbr>e><br><br>红色是修改的部分。意思是当对应的数据不存在时 忽略掉,用null值填充。该属性默认值:exception 。</wbr></wbr></wbr></wbr>