Conversation
|
Jongdae519
reviewed
Jul 10, 2024
| @Override | ||
| public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException { | ||
| User user = userRepository.findByEmail(email) | ||
| .orElseThrow(() -> new GlobalException(FailureInfo.NOT_EXIST_USER)); |
There was a problem hiding this comment.
UsernameNotFoundException를 throw하는 곳이 없지 않나요?
Jongdae519
reviewed
Jul 10, 2024
| @Builder | ||
| @NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
| @AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
| @SQLDelete(sql = "UPDATE contract SET is_deleted = true WHERE id = ?") |
There was a problem hiding this comment.
삭제처리라는 메서드를 업데이트로 하게끔 구성해도 될 것 같은데,
DB에서 삭제처리가 될 때 @SQLDelete로 DML문을 바꾸는 장점이 뭔지 궁금하네요
Member
Author
There was a problem hiding this comment.
이 엔티티는 soft delete가 기본이라는 것을 개발자에게 명시하고
개발자가 실수로 hard delete를 하는 경우를 방지하고자 했습니다.
기본적으로 soft delete이지만 hard delete가 필요한 경우에는 repository 함수에 @query와 JPQL을 사용해서 직접 delete 쿼리를 발생시킬 생각입니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



관련 이슈
구현 기능
참고 사항