강의

멘토링

커뮤니티

Inflearn Community Q&A

uhi's profile image
uhi

asked

Real-world! Spring Boot and JPA Utilization 1 - Web Application Development

Order, Order Item Entity Development

생성메서드에서요 ~!

Written on

·

331

2

order(주문)을 넣을떄 

 

생성메소드를 만들어 줬는데 

 

1)주문 엔티티에서

왜 생성자를 쓰지 않고 생성메소드를 써서 만드나요

이것도 도메인 설계로 엔티티에 다 넣어주려고 그런건가요??

 

2) 생성메소드를 static으로 만든 이유가 있을까요?

웹앱spring-bootJPAspringjava

Answer 1

2

안녕하세요. 유하님, 공식 서포터즈 David입니다.

아래 글을 참고해주세요.

https://tecoble.techcourse.co.kr/post/2020-05-26-static-factory-method/

감사합니다.

uhi's profile image
uhi

asked

Ask a question