JPA : update 报错:Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException: Executing an update/delete query

JPA : update 报错:Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException: Executing an update/delete query

在接口上加注解 @Transactional

org.springframework.transaction.annotation.Transactional;

JPA : update 报错:Not supported for DML operations

在方法上加注解 @Modifying

posted @ 2022-09-14 09:56  lovleo  阅读(315)  评论(0编辑  收藏  举报