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

[feat] Customer id 변경 #58

Merged
merged 12 commits into from
Aug 15, 2024
Merged

Conversation

kimhyun5u
Copy link
Member

@kimhyun5u kimhyun5u commented Aug 15, 2024

💡 다음 이슈를 해결했어요.

Issue Link - #40

Discussion Link - #36


💡 이슈를 처리하면서 추가된 코드가 있어요.

  • Customer: id 값을 UUID 로 변경
  • 기존 Customer id를 사용한 Service, DTO, test: 사용된 Long 타입을 UUID 또는 String 으로 변경

💡 이런 고민을 했어요.

  • 기존 Long Type은 AUTO_INCREMENT 를 위해 db를 참조해야하므로 쓰기지연이 발생하지 않는다. 하지만, UUID 는 hibernate 에서 생성한 uuid를 직접 넣기 때문에 쓰기지연이 발생한다. 따라서, 그냥 save() 를 사용할 경우 Service 층에서 DataIntegrityViolationException을 잡지 못하고 상위 계층으로 넘어간다.

해결방안: saveAndFlush() 를 사용한다.

  • Service 에서 Controller 로 id 를 전달할 때 UUID로 전달하냐 String 으로 전달하냐

String 을 전달하는 게 더 명확한 것 같음


✅ 셀프 체크리스트

  • 내 코드를 스스로 검토했습니다.
  • 필요한 테스트를 추가했습니다.
  • 모든 테스트를 통과합니다.
  • 브랜치 전략에 맞는 브랜치에 PR을 올리고 있습니다.
  • 커밋 메세지를 컨벤션에 맞추었습니다.
  • wiki를 수정했습니다.

- 논의 - #36 반영
- Long 에서 UUID 로 변경
- 논의 - #36 반영
- Long 에서 UUID 로 변경
- DataIntegrityViolationException 를 서비스 레이어에서 잡지 못하면 에러 명시된 출럭
@kimhyun5u kimhyun5u added the ✨ Feature 기능 개발 label Aug 15, 2024
@kimhyun5u kimhyun5u added this to the 프로토타입 만들기 milestone Aug 15, 2024
@kimhyun5u kimhyun5u requested a review from a team August 15, 2024 00:55
@kimhyun5u kimhyun5u self-assigned this Aug 15, 2024
@kimhyun5u kimhyun5u linked an issue Aug 15, 2024 that may be closed by this pull request
@kimhyun5u kimhyun5u marked this pull request as draft August 15, 2024 00:55
@kimhyun5u kimhyun5u marked this pull request as ready for review August 15, 2024 04:14
- getId() 의 반환값 UUID 로 변경
Copy link
Member

@Dr-KoKo Dr-KoKo left a comment

Choose a reason for hiding this comment

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

기능상 중요하지는 않은 커맨트라서 승인드립니다.

Copy link
Member

@june-777 june-777 left a comment

Choose a reason for hiding this comment

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

확인 완료했습니다

Copy link
Contributor

@Hyeon-Uk Hyeon-Uk left a comment

Choose a reason for hiding this comment

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

LGTM :)

@kimhyun5u kimhyun5u merged commit 75a532e into main Aug 15, 2024
1 check passed
@kimhyun5u kimhyun5u deleted the feature/40_kimhyun5u_customer-id-변경 branch August 15, 2024 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 기능 개발
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[기능] Customer Id 변경
4 participants