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 |
Tags
- spring mapper annotation
- JAVA Exception 종류
- repository annotation
- spring DB Connection
- doker logs tail
- 도커 logs
- 도커 로그 확인
- Spring
- Transactions Propagation Option
- 도커 컨테이너 로그
- vueslot
- AllArgsConstructor
- spring mapper
- JPA DB Connection 다중
- spring @mapper
- Vue
- mapper annotationo
- Spring JPA Specification
- @Builder @NoArgsConstructor
- vuecomponent
- spring JPA DB multi Connection
- spring repository
- Data Annotation
- CrudRepository update
- NoArgsConstructor
- JpaRepository update
- docker 로그
- 자바버그수정
- JPA DB 다중 Connection
- spring JPA DB Connection
Archives
- Today
- Total
개발을 잘하고 싶은 개발자
[Spring JPA] JpaRepository update업데이트 하고 싶지만 save 본문
JpaRepository를 사용하면서
findAllById, save, saveAndFlush 등등 편리하게 사용해오다가
수정 Update 업데이트 기능을 개발할 일이 있어 검색해 보았다.
나는 update(S entity) 라는 메서드를 지원해주지 않을까 라는 기대감에 u.. p... 까지 타이핑도 해보았지만
없.었.다.
save()를 사용해야 한다는 걸 알고
UserDto
id
name
birth
UserDto user = new UserDto();
user.setId("153");
user.setName("sofia");
UserDto save(UserDto user);
이렇게 사용했다가 birth가 날아갔다ㅠ
birth에 값을 넣어주지 않았다고 birth를 null로 update 한 것이다...
Dto에서 단 하나의 데이터만 수정해도 모든 데이터와 같이 save 해주어야 한다니ㅠ

'Backend > spring' 카테고리의 다른 글
[Spring] @Repository는 언제 쓰나요? (0) | 2021.08.07 |
---|---|
[Spring] JPA DB Connection 다중으로 사용하기! (0) | 2021.08.03 |
[Spring] RESTful 서비스 설계 - Exception 설계한 Response 처리 (0) | 2021.07.24 |
[Spring] DTO, VO, ENTITY 차이를 알고 써보자 (0) | 2021.07.22 |
[Spring JPA] PROCEDURE 프로시져 호출 (0) | 2021.07.17 |