慕勒6682347
2017-04-21 16:48
@Test @Transactional// 插入修改是需要事务的 public void testUpdate() throws Exception { System.out.println(employeeRepository.update("test3", 50)); }
直接 在Test 方法加Transactional
没用么=== 只想测试DAO 层怎么破
我试了 返回给我 修改个数1 其实数据库 根本没改过--
以解决
其实是Spring Test 自动回滚了事务
无语。。。
加上@Commit注解 提交事务
轻松愉快之玩转SpringData
34086 学习 · 121 问题
相似问题