스프링부트 13

[Spring Boot] Maven 환경에 Swagger 적용하기

pom.xml 파일에 Swagger 의존성 추가 io.springfox springfox-swagger2 2.9.2 io.springfox springfox-swagger-ui 2.9.2 config라는 패키지 생성 후에 Swagger관련 코드 작성 SwaggerConfiguration.java package com.springboot.hello.config; import org.springframework.boot.autoconfigure.influx.InfluxDbOkHttpClientBuilderProvider; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configu..

BACK/SPRING 2022.10.11

[JPA] Executing an update/delete query 에러 해결

Executing an update/delete query; nested exception is javax.persistence. TransactionRequiredException: Executing an update/delete query with root cause 에러문 그대로 JPA에서 update/delete 쿼리를 사용할 때는 Transaction 처리를 해줘야 한다. @Transactional @Modifying(clearAutomatically = true) @Query("UPDATE Share s SET s.progress= :progress WHERE s.user.userId= :userId and s.post.id = :postId") void updateProgress(Long u..

BACK/JPA 2022.08.31
반응형