Notice
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- java lambda
- Spring JPA
- java.util.list
- ResponseBody
- micrometer tracing
- spring
- @FunctionalInterface
- aws secretmanager
- kotlin
- DeferredImportSelector
- SpringMVC
- spring MVC
- grpc
- awssecretsmanagerpropertysources
- list
- asyncconfigurer
- wire type
- HashMap
- jpa
- java list
- EnableWebMvc
- map
- traceId
- traceasynccustomautoconfiguration
- elasticsearch
- java
- Sleuth
- Spring Boot
- asynccustomautoconfiguration
- CompletableFuture
Archives
- Today
- Total
목록@modifying (1)
du.study기록공간

JPA를 사용하다보면 가끔 Bulk 업데이트를 위하여, query를 사용하여 업데이트 하는 경우가 있습니다. 그리고 이 경우, 우리는 항상 @modifying를 사용하게 됩니다. 그렇다면 어째서 @modifying를 사용해야만 하는것을까라는 궁금증이 생겼습니다. 그래서 @Query를 이용해서 업데이트 쿼리를 작성하되 @modifying를 사용, 미사용 상태로 돌려본 후, 결과를 지켜봤습니다. 우선 Repository interface에 @Modifying을 선언하지 않고 실행한 결과입니다. @Component public class JpaRunner implements ApplicationRunner { @Autowired private Repo repo; @Transactional @Override p..
JPA
2020. 8. 26. 01:13