-
Notifications
You must be signed in to change notification settings - Fork 151
[4기 박현지] Mission 2: 영속성 컨텍스트 #263
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
base: hyeon-z
Are you sure you want to change the base?
Conversation
CustomerRepository의 CRUD 메서드 활용
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
||
@BeforeEach | ||
void setUp() { | ||
repository.deleteAll(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반복되는 EntityManager 생성을 setup method를 통해서 하는건 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵! 적용했습니다~!
refactor: 공통 메서드 https://github.com/beforeeach 메서드로 분리
|
||
transaction.commit(); | ||
|
||
transaction.begin(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
삭제에 대한 검증이니 transaction.begin()은 remove() 전에 선언하는것은 어떨까요?
find()는 굳이 transaction 안에 있지 않아도 되니까요..!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
첫 번째 find
문은 persist
후 commit
했을 때 잘 저장됐음을 확인하기 위함이고 현재 begin()
은 remove()
위에 있는데 혹시 어떤 부분을 말씀하시는 걸까요..?
@Autowired | ||
CustomerRepository repository; | ||
|
||
@Autowired | ||
EntityManagerFactory emf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
두 개를 다 사용하는 이유가 있나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CustomerRepository
의 메서드로도 가능한데 강의 때 영속성 컨텍스트의 생명주기에 대해 학습해서 EntityManagerFactory
를 사용해서 명시적으로 구현헀습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
정확히 테스트하고 싶은 범위는 어떻게 되나요??
📌 과제 설명
영속성 컨텍스트 관련 테스트 작성
👩💻 요구 사항과 구현 내용
✅ 피드백 반영사항
✅ PR 포인트 & 궁금한 점