- 博客(3)
- 收藏
- 关注
原创 jpa 报错:No EntityManager with actual transaction available for current thread - cannot reliably proce
No EntityManager with actual transaction available for current thread - cannot reliably process 'remove' call背景:使用jpa编写删除方法时出现报错代码:int deleteUserByUserName(String username);报错:Exception in thread "main" org.springframework.dao.Invalid...
2021-11-25 09:30:45
8914
原创 Jpa使用@Query时 报错Validation failed for query for method public abstract
在Jpa中使用@Query注解时出现以下错误:Validation failed for query for method public abstract解决方法:这是由于在@Query注解中使用原生SQL时未将nativeQuery属性值显式设为true@Query(nativeQuery = true,value = "update user as u set u.userName=?1 where u.userName=?2") void updatePasswordByUser
2021-11-24 22:01:33
1640
原创 此处不允许使用特性 transaction-manager
idea自动生成了如下命名空间将其中的cache换成tx就行了xmlns:tx="http://www.springframework.org/schema/tx"
2021-11-16 15:21:12
3289
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人