org.hibernate.ObjectNotFoundException: No row with the given identifier exists:

产生该问题的原因:http://blog.csdn.net/eyejava/article/details/1896492

 

解决:

原来的配置:
<many-to-one class="com.art.model.user.UserInfo" fetch="join" name="userInfo" >
   <column name="userId" unique="true"/>
</many-to-one>

修改后的:
<many-to-one class="com.art.model.user.UserInfo" fetch="join" name="userInfo" not-found="ignore">
   <column name="userId" unique="true"/>
</many-to-one>

 

如果使用注解not-found="ignore" 换成 @NotFound(action=NotFoundAction.IGNORE)

 

 

你可能感兴趣的:(org.hibernate.ObjectNotFoundException: No row with the given identifier exists:)