주소를 업데이트하고 싶습니다.스프링 데이터 jpa 쿼리 문자열 오류
@Modifying
@Query("update UserInfo u set u.address = ?1 where u.username = ?2")
void setAddress(String address, String username);
하지만 작동하지 않습니다.
org.springframework.web.util.NestedServletException: Request processing failed;
nested exception is org.springframework.dao.InvalidDataAccessApiUsageException:
|Exception Description: No transaction is currently active; nested exception is
javax.persistence.TransactionRequiredException: |Exception Description: No transaction
is currently active
는 그리고 내 쿼리 문자열이 예외를 차지 이유 알 수없는 소스
말한다?
업데이트 쿼리에서 mutiple 필드를 업데이트하는 방법?
@Query("update UserInfo u set u.address = ?1, u.phoneNumber = ?2 where u.username = ?3")