[4기 박은지] Springboot-jpa weekly 미션 1차 PR입니다.#307
Open
1o18z wants to merge 92 commits intoprgrms-be-devcourse:Eunjifrom
Open
[4기 박은지] Springboot-jpa weekly 미션 1차 PR입니다.#3071o18z wants to merge 92 commits intoprgrms-be-devcourse:Eunjifrom
1o18z wants to merge 92 commits intoprgrms-be-devcourse:Eunjifrom
Conversation
…1/CustomerRepositoryTest.java Co-authored-by: SR <kslbsh@gmail.com>
dojinyou
reviewed
Aug 2, 2023
src/main/java/com/programmers/week/customer/domain/Customer.java
Outdated
Show resolved
Hide resolved
src/main/java/com/programmers/week/customer/application/CustomerService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/programmers/week/customer/ui/CustomerController.java
Outdated
Show resolved
Hide resolved
| @Entity | ||
| @Getter | ||
| @NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
| public class OrderItem extends BaseEntity { |
Member
There was a problem hiding this comment.
@ManyToMany 가 아닌 중간 관계 테이블을 엔티티로 직접 구현하는 이유가 있으신가요?
| jpa: | ||
| open-in-view: false | ||
| hibernate: | ||
| ddl-auto: create |
Member
There was a problem hiding this comment.
create 말고 다른 옵션들은 어떻게 있나요? create 쓴 이유가 뭘까요?
Author
|
JPA를 공부하고 적용하는 데에 생각보다 오래 걸리면서 시간을 맞춰 제출을 하려다 보니 많은 부분을 신경쓰지 않고 작성했던 것 같습니다 🥲 |
dojinyou
reviewed
Aug 4, 2023
| @CreatedDate | ||
| private LocalDateTime createdAt; | ||
|
|
||
| @Column(columnDefinition = "TIMESTAMP") |
Member
There was a problem hiding this comment.
timestamp precision에 대해서 알아보시면 좋을 것 같아요
Comment on lines
+16
to
+17
| private static final int MIN_POWER = 0; | ||
| private static final long MAX_POWER = 1000000; |
seung-hun-h
approved these changes
Aug 7, 2023
Comment on lines
+15
to
+20
| @DataJpaTest | ||
| public class CustomerRepositoryTest { | ||
|
|
||
| @Autowired | ||
| EntityManagerFactory emf; | ||
|
|
There was a problem hiding this comment.
@DataJpaTest를 사용하시는데 수동으로 트랜잭션을 시작하고 커밋할 필요가 있나요?
| public CustomerResponse findById(Long id) { | ||
| return customerRepository.findById(id) | ||
| .map(CustomerResponse::from) | ||
| .orElseThrow(() -> new IllegalArgumentException(Message.CUSTOMER_IS_NO_EXIST)); |
| import static org.junit.jupiter.api.Assertions.assertAll; | ||
| import static org.junit.jupiter.api.Assertions.assertFalse; | ||
|
|
||
| @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK) |
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.
📌 과제 설명
미션1 : 2. JPA 소개(단일 엔티티를 이용한 CRUD를 구현)
미션2 : 3. 영속성컨텍스트(customer 엔티티를 이용하여 생명주기 실습)
미션3 : 4-2. 연관관계매핑(order, order_item, item의 연관관계 매핑 실습)