Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

포트폴리오 Batch Insert 및 Update 구현하기 #104

Merged
merged 4 commits into from
Oct 17, 2023

Conversation

Rizingblare
Copy link
Member

추가된 파일 :
PriceItemJDBCRepository.java
PriceItemJDBCRepositoryImpl.java
ImageItemJDBCRepository.java
ImageItemJDBCRepositoryImpl.java

  • 포트폴리오 가격 및 이미지 변경 시 Batch Insert 및 Update 구현
  • PortfolioService와 ImageItemService에서 add 및 update 로직 변경
  • 로그를 확인하기 위해선 application-local.yaml 파일에 다음 설정 필요
// application-local.yaml
logging:
  level:
      com.kakao.sunsuwedding: DEBUG
      #org.hibernate: DEBUG
      org.springframework.jdbc.core.JdbcTemplate: DEBUG # JDBC BatchInsert logging 설정

rizingblare added 3 commits October 17, 2023 15:21
- 포트폴리오 서비스 로직: 가격 일괄 등록 로직 수정
- PriceItem JDBC Repository 추가
- PriceItem JDBC Batch Insert Impl
- 포트폴리오 이미지 서비스 로직 수정: saveImage를 batchInsert 로직으로
- JDBC Template을 활용한 ImageJDBCRepository 인터페이스,
  ImageJDBCRepositoryImpl
- 이미지 업데이트는 삭제, 메서드화 되어있으므로 알아서 같이 구현되었음
- 포트폴리오 가격 batch insert 구현
- 주석 달음
String sql = "INSERT INTO imageitem_tb (portfolio_id, origin_file_name, file_path, file_size, thumbnail) VALUES (?, ?, ?, ?, ?)";

jdbcTemplate.batchUpdate(sql, imageItems, imageItems.size(),
(ps, priceItem) -> {
Copy link
Contributor

@chaee813 chaee813 Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

동작에는 문제가 없지만 이 부분 imageItem 아닐까요!? 이것만 따로 PR 날리기 귀찮으실 것 같아서 수정하고 푸시 해주시면 머지하겠습니다! 구현하시느라 고생하셨어요!! :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chaee813 앗 오타를 내버렸네요, 수정했습니다. 감사합니다 !!

- ImageItemJDBCRepositoryImpl.java에 있는 오타 수정
- priceItem -> imageItem
Copy link
Contributor

@chaee813 chaee813 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다~!

@chaee813 chaee813 merged commit b39f4cd into weekly Oct 17, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants