Skip to content

🚀 4단계 - EntityEntry - #257

Open
sang5c wants to merge 2 commits into
next-step:sang5cfrom
sang5c:step4
Open

🚀 4단계 - EntityEntry#257
sang5c wants to merge 2 commits into
next-step:sang5cfrom
sang5c:step4

Conversation

@sang5c

@sang5c sang5c commented Nov 21, 2024

Copy link
Copy Markdown

안녕하세요 리뷰어님!

어떤 방향으로 미션을 수행하며 풀어나가야 할지 몰라 힌트를 얻고자 일단 PR을 올려봅니다..!

EntityEntry가 언제 어떻게 쓰여야 좋을지 잘 모르겠습니다.
현재 상태에서 어떤 부분을 고민하면서 구현하면 좋을지 힌트 부탁드립니다 🙏

@wooobo wooobo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

안녕하세요 상오님~

4단계 까지 잘오셨습니다 🤙
코멘트남겨 놓았는데 도움이 되었으면 좋겠네요~

그럼 화이팅입니다!

@@ -0,0 +1,17 @@
package persistence.entity;

public class EntityEntry {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

JPA가 돌아가는 어플리케이션 세계실제 DB 세계 는 다른곳에 있죠?
이러한 다른 두개의 세계를 Entity 객체라는 개념을 통해 안전하고 효율적으로 관리해주어야합니다.

그럼, JPA의 Entity(어플리케이션)DB로 동기화 하는데 시간이 걸릴수도 있을것 같습니다. 그럼 우리는 대기해야하고 Entity에 대한 접근을 제안하여 온전한 동기화 과정을 이루어지게 해야 할 듯합니다.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  1. EntityEntry는 각 엔티티의 상태를 추적하는 데 사용
  2. 영속화된 Entity의 상태를 가지므로써
    • MANAGED → DELETED는 허용되지만 MANAGED → GONE은 허용하지 않을 수 있음.
    • GONE -> MANAGED 허용할 수 없음
      • 이유가 뭘까요?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

그렇다면, EntityEntry는 Entity마다 상태를 관리해주면 좋을것 같습니다. EntityEntry가 Entity의 식별자를 가지고 있어야하는 이유가 될수 있겠네요.

개인적인 생각으론 EntityEntry 는 어떤환경으로 구축방향을 잡느냐에 따라 다르다고 생각해요~ 코멘트는 참고 정도로 봐주세요~

모든 상태를 다 적용하실 필요는 없다고 생각합니다. 중요한것은 상오님만의 생각으로 개념을이해하는것입니다.

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.

2 participants