Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 자바
- JDBC
- 인프런
- db
- 백준
- java
- Spring Boot
- 스프링 핵심 원리
- Android
- 알고리즘
- jpa
- http
- QueryDSL
- Servlet
- 스프링 핵심 기능
- Greedy
- transaction
- springdatajpa
- JPQL
- pointcut
- Thymeleaf
- 김영한
- Proxy
- spring
- Exception
- SpringBoot
- kotlin
- 그리디
- 스프링
- AOP
Archives
- Today
- Total
목록벌크연산 (1)
개발자되기 프로젝트
Query Method, 벌크성 수정 쿼리
예를들어 모든 인원의 나이를 하나 씩 올리거나, 연봉을 올리거나 할 때, 엔티티를 하나하나 불러와서 업데이트 하는 것 보다. DB에서 bulk로 변경하는 편이 적합하다. 1. JPA로 bulk 연산 executeUpdate()를 실행하면 업데이트, 삭데된 엔티티의 수를 반환. public int bulkAgePlus(int age){ return em.createQuery("update Member m set m.age = m.age + 1 where m.age >= :age") .setParameter("age", age) .executeUpdate(); //Returns: the number of entities updated or deleted } public int bulkAgePlus(int a..
인프런/[인프런] Spring Data JPA
2021. 8. 29. 22:11