一篇文章需要关联很多个标签,所以他们呈一对多(多对多)的关系 org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.hs.model.Article.tagMo…
MyBatis关联查询和懒加载错误 今天在写项目时遇到了个BUG.先说一下背景,前端请求更新生产订单状态,后端从前端接收到生产订单ID进行查询,然后就有问题了. 先看控制台报错: org.apache.ibatis.executor.ExecutorException: Statement returned more than one row, where no more than one was expected. 很明显,预期查出一条记录的结果查出了多条记录.因为在实现 service 层代…