4단계 - EntityEntryStep4 - #252
Open
dohoonkim023 wants to merge 5 commits into
Open
Conversation
wooobo
requested changes
Nov 12, 2024
wooobo
left a comment
There was a problem hiding this comment.
안녕하세요 도훈님!
4단계 잘 진행해주셨습니다.
코멘트 남겨 놓았어요~ 확인 후 재요청 부탁드립니다~
그럼 화이팅입니다!
| public void clear() { | ||
| persistedEntities.clear(); | ||
| public List<Object> getDeletedEntities() { | ||
| return entityEntries.values().stream().filter(e -> e.getStatus() == Status.DELETED).map(EntityEntry::getEntity) |
There was a problem hiding this comment.
Suggested change
| return entityEntries.values().stream().filter(e -> e.getStatus() == Status.DELETED).map(EntityEntry::getEntity) | |
| return entityEntries.values().stream().filter(e -> e.isDeleted().map(EntityEntry::getEntity) |
객체에게 물어볼수 있겠네요 🤔
| @@ -0,0 +1,10 @@ | |||
| package persistence.entity; | |||
|
|
|||
| public enum Status { | |||
There was a problem hiding this comment.
이 경우 EntityEntry 객체의 상태를 GONE으로 변경하는 것이 과연 의미가 있을지 고민이 되었습니다.
이 부분에 대한 의견이나 조언 주시면 감사하겠습니다!
우선 도훈님의 의견도 궁금해서 아래 질문드려 볼께요!
There was a problem hiding this comment.
case 1
func test() {
em.persist(person1);
em.flush();
em.remove(person1);
em.persist(person1); <=== (1)
em.flush();
}(1) persist 후 flush될때 어떤 흐름을 기대하시나요?
case 2
func test() {
em.persist(person1);
em.flush();
em.remove(person1);
em.flush();
em.persist(person1); <=== (1)
}(1) persist 후 어떤 결과를 기대하시나요?
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.
기능구현이 완료되어 리뷰요청 드립니다~ 리뷰 잘부탁드립니다 🙏
구현 중에 GONE 상태(Status)를 어떻게 활용할지 고민이 많았습니다.
GONE은 엔티티가 영속성 컨텍스트에서 더 이상 관리되지 않는 상태를 의미하는데,
이 경우 EntityEntry 객체의 상태를 GONE으로 변경하는 것이 과연 의미가 있을지 고민이 되었습니다.
이 부분에 대한 의견이나 조언 주시면 감사하겠습니다!