안녕하세요, 이 프로그램을 좀 더 발전시켜보고 싶은데요 주문할 때 상품을 여러개 선택하도록 만들고싶은데, 이렇게 하려면 상품과 주문 수량을 골랐을 때 다시 화면에 추가로 선택 칸이 만들어져야 할 것 같습니다. 이 기능을 혹시 스프링과 타임리프 만으로 구현할 수 있나요, 아니면 자바스크립트를 공부해서 만들어야 할까요? 대략적인 가이드라도 조언 부탁드립니다. 감사합니다.
강의를 보던 중에 연관 관계 메소드에 관련되어서 질문이 있습니다. Category 클래스에서 보면 엔티티 안에서 멤버 변수들끼리 양방향 관계를 맺는 parent랑 child가 있는데 아래 코드가 잘 이해가 안됩니다. this.child는 멤버 변수 child를 의미하는데 child 리스트 안에 파라미터인 child를 넣는다는 뜻인건가요? 그리고 child.setParent에는 왜 this가 들어가나요..? this는 객체 자신인 Category라고 알고 있는데 제가 잘못 안건가요? public void addChildCategory (Category child){ this . child .add(child) ; child.setParent( this ) ; }
스프링 데이터 jpa를 사용하여 여러 연관관계를 가진 엔티티를 만들었는데 이 강의에서처럼 연관관계 편의메서드에서 하신 것처럼 연관관계가 설정된 엔티티에 따로 설정(member.getOrders().add(this) 같은) 을 따로 해주지 않았는데 문제가 없었습니다. 특별히 어떤 이유에서 연관관계 설정 메서드를 정의하신건가요?
1. 강의 내용과 관련된 질문인가요? 아니오 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예 3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예 [질문 내용] 안녕하세요? JPA 수업 수강 후, 실제 업무에 적용하는 와중에 궁금한 점이 있어서 질문 남깁니다. DB Update를 위한 Entity Method의 파라미터로 DTO를 받는 것이 프로그램 구동상에는 전혀 문제는 없는데요. Domain driven design을 구현하는데에 있어서 엔티티 메소드의 파라미터로 DTO를 집어넣는게 바람직한 설계(?) 인지 문의 드립니다. 질문의 보다 빠른 이해를 위해 샘플 코드 및 시나리오를 아래와 같이 남깁니다. - 상황 : 회원정보수정 API의 input으로 MemberDTO를 받음 - Member DTO 내에 ContactDTO, List<AddressDTO>를 가진 구조 (Nested) class MemberDTO { ... private ContactDTO contactDTO; private List<AddressDTO> addressDTO; ... } - Service 레벨에서 memberRepository.findById() 통하여 Member Entity를 불러옴. - Member Entity와 Contact Entity은 1:1조인, Address Entity와는 1:N 조인 - Contact 및 Address 업데이트를 위해 Entity레벨에 다음의 메소드를 구현해두었으며, member.getContact().updateContact(contactDTO)로 해당 메소드를 호출 @Entity class Contact(또는 Address) { ... public void updateContact (ContactDTO contactDTO) { ... this.phoneNumber = contactDTO.getPhoneNumber(); ... ... } } 감사합니다.
안녕하세요. 강의 정말 잘 듣고있습니다! 다름이 아니라 아..마..도? devtools dependency를 추가해주고 난 다음 발생한 것 같은데 hello.html에서 ${data} 빨간줄이 그어져 있네요. 마우스로 갖다 대보니 cannot resolve 'data'라는 문구가 뜨지만 실행 시키면 콘솔 창에 별다른 오류도 없고 devtools 등 전부 정상 작동 합니다. 어떤 것 때문에 그런것일까요??
[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] 김영한 멘토님 덕분에 스프링에 대해서 쉽게 공부할 수 있어서 항상 감사함을 느끼고 있습니다. 멘토님의 강의를 복습하던 중 궁금한 것이 생겨서 질문 남깁니다. 제가 의구심을 가지는 코드 부분은 다음과 같습니다. @Service @Transactional(readOnly = true) @RequiredArgsConstructor public class OrderService { private final MemberRepository memberRepository; private final OrderRepository orderRepository; private final ItemRepository itemRepository; /** 주문 */ @Transactional public Long order(Long memberId, Long itemId, int count) { //엔티티 조회 Member member = memberRepository.findOne(memberId); Item item = itemRepository.findOne(itemId); .... } .... } @Service @Transactional(readOnly = true) @RequiredArgsConstructor public class ItemService { private final ItemRepository itemRepository; .... public Item findOne(Long itemId) { return itemRepository.findOne(itemId); } } @Repository @RequiredArgsConstructor public class ItemRepository { .... public Item findOne(Long id) { return em.find(Item.class, id); } } 여기서 제가 궁금한 점은 OrderService에서 ItemService 대신 itemRepository를 주입한 이유가 궁금합니다! 물론, 둘 다 실행은 동일하게 되지만, itemRepository를 ItemService에서만 접근하게 하고, 타 클래스에서 item에 관한 로직은 무조건 ItemService으로만 접근하는 식으로 해야 item에 관련된 로직들이 응집도가 높아지고, 모듈 간 결합도가 낮아지지 않을까요?? 멘토님의 의견이 궁급합니다!
[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] 엔티티 클래스 개발2에서 FK 관련 질문입니다! FK를 안걸고 인덱스를 거는 방식도 있고 시스템마다 다르다고 하셨는데, Id값은 똑같이 가지고 있고 거기에 인덱스를 거는 것인가요? 그리고 이렇게 하면 속도가 왜 더 빨라지는 것인가요?
안녕하세요 해당 수업에서 만약 Book 의 모든 필드를 변경하고자 한다면 실제 실무에서는 어떻게 사용하면 좋을까 하면서 만들어 보았는데, 틀린 부분이나 고쳐야할 부분이 있다면 말씀해주실 수 있을까요 ? 작은 부분이라도 조언 해주시면 감사하겠습니다! 1. DTO @Getter @Setter public class UpdateBookDto { private String name ; private int price ; private int stockQuantity ; private String author ; private String isbn ; public static UpdateBookDto updateBookAll ( String name , int price , int stockQuantity , String author , String isbn) { UpdateBookDto bookDto = new UpdateBookDto() ; bookDto. name = name ; bookDto. price = price ; bookDto. stockQuantity = stockQuantity ; bookDto. author = author ; bookDto. isbn = isbn ; return bookDto ; } } 2. Controller public class ItemController { @PostMapping ( "/{itemId}/edit" ) public String updateItem ( @PathVariable String itemId , @ModelAttribute ( "form" ) BookForm form) { UpdateBookDto bookDto = UpdateBookDto. updateBookAll ( form.getName() , form.getPrice() , form.getStockQuantity() , form.getAuthor() , form.getIsbn() ) ; itemService.updateItem(form.getId() , bookDto) ; return "redirect:/items" ; } } 3. Service public class ItemService { @Transactional public void updateItem (Long itemId , UpdateBookDto dto) { Book findBook = (Book) itemRepository.findOne(itemId) ; findBook.changeBook( dto.getName() , dto.getPrice() , dto.getStockQuantity() , dto.getAuthor() , dto.getIsbn() ) ; } } 4. Book public class Book extends Item { public void changeBook (String name , int price , int stockQuantity , String author , String isbn) { super .changeItem(name , price , stockQuantity) ; this .author = author ; this .isbn = isbn ; } }
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 안녕하세요. 1. 2. 사진첨부해드리고 말씀드리겠습니다 1) member객체를 인스턴스하고, em.persist(member)를 할 시점에서 List<Order>에 여러 order객체들이 있을경우 같이 저장하기위해 CASCADE를 ALL로 지정한게 맞는지 궁금합니다. 2) 위의 내용이 맞을 때, 밑에 내용에서 createOrder 메소드 for문 안에서 order.addOrderItem(orderItem)를 하고나서 order를 persist 할경우, 여러개의 orderItem이 같이 저장되기위해서 해당 Order 엔티티안에 orderItems 리스트객체를 cascade cascadeType.All선언해야하는데, OrderItem이 Item과 연관관계가 있어서 cascade all를 선언 안하는게 맞는지 궁금합니다. 만약 그게 맞다면 caseCade.All를 선언 안하면 order 객체을 persist 할 시점에 List<orderItem>들을 같이 저장이 안되는걸로 알고 있습니다. 그렇다면 order 엔티티 안에 createOrder 메소드로 반환값 받는 order에 있는 OrderItems 리스트 객체를 for문으로 돌려서 각각의 OrderItem객체를 persist 하여 order값도 같이 persist 시키는게 맞는건지 궁금합니다.
안녕하세요. 도메인 내에서 비즈니스 로직을 작성하는 것이 객체지향적이다 라는 말씀을 듣고 생각해보다가, 양방향 연관 관계 편의 메서드에서의 setter 사용이 생각났습니다. public class Order { public void setDelivery (Delivery delivery) { this .delivery = delivery ; delivery.setOrder( this ) ; } } 이와 같이 양방향 연관 관계에서는 한쪽에 setter 함수가 불가필 할듯 한데, setter 함수를 무조건적으로 사용하면 안되는 것은 아니고 지양한다는 정도로만 받아들여도 될까요 ? 감사합니다.
[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? 일부 예 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예 3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예 [질문 내용] 안녕하세요, 스프링 부트와 JPA 활용 강의를 듣고 토이프로젝트를 진행하려고 하는데, entity relation diagram을 간단하게 그릴 툴이 뭐가 있을까 싶어서 질문 남깁니다. Draw.io나 erdcloud 등의 사이트를 봤지만 초심자가 무턱대고 접하기엔 생각보다 벽이 있어서, 강사님께서 직접 사용하시는 툴은 어떤 것인지 궁금해 질문합니다.
일단 상품등록하는데 문제는 없습니다. 위와 연결된 Controller에 매핑과 BookForm 설정 똑같이 했는데 강의에 영한님이 한것처럼 html에서 th:object="${form}" 나 th:field="*{name}" 을 command+click 으로 연결된곳으로 갈수도 없고 Cannot resolve 'form' 오류 뜨면서 빨간줄 그어지는데 해결할수 있는 방법있을까요? 저도 그 편한 기능 쓰고 싶습니다 진짜루 ..ㅠㅠ 인텔리제이는 IntelliJ IDEA 2022.1.2 (Ultimate Edition) 쓰고 있습니다.
npm ERR! code 1 npm ERR! path C:\Users\지은\Downloads\boilerplate-mern-stack-master\boilerplate-mern-stack-master\node_modules\bcrypt npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\지은\AppData\Roaming\nvm\v16.15.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\지은\Downloads\boilerplate-mern-stack-master\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\지은\Downloads\boilerplate-mern-stack-master\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1) npm ERR! node-pre-gyp info it worked if it ends with ok npm ERR! node-pre-gyp info using node-pre-gyp@0.14.0 npm ERR! node-pre-gyp info using node@16.15.0 | win32 | x64 npm ERR! node-pre-gyp WARN Using needle for node-pre-gyp https download npm ERR! node-pre-gyp info check checked for "C:\Users\지은\Downloads\boilerplate-mern-stack-master\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node" (not found) npm ERR! node-pre-gyp http GET https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp http 404 https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.8 and node@16.15.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp) npm ERR! node-pre-gyp http 404 status code downloading tarball https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.0.0 npm ERR! gyp info using node@16.15.0 | win32 | x64 npm ERR! gyp info ok npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.0.0 npm ERR! gyp info using node@16.15.0 | win32 | x64 npm ERR! gyp ERR! find Python npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON npm ERR! gyp ERR! find Python checking if "python3" can be used npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error npm ERR! gyp ERR! find Python checking if "python" can be used npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python39\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python39\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python39\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python39-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python39-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python38\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python38\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python38\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python38-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python38-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python37\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python37\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python37\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python37-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python37-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python36\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python36\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python36\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python36-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python36-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be run npm ERR! C:\Users\지은\AppData\Local\npm-cache\_logs\2022-05-25T05_57_34_949Z-debug-0.lognpm ERR! code 1 npm ERR! path C:\Users\지은\Downloads\boilerplate-mern-stack-master\boilerplate-mern-stack-master\node_modules\bcrypt npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\지은\AppData\Roaming\nvm\v16.15.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\지은\Downloads\boilerplate-mern-stack-master\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\지은\Downloads\boilerplate-mern-stack-master\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1) npm ERR! node-pre-gyp info it worked if it ends with ok npm ERR! node-pre-gyp info using node-pre-gyp@0.14.0 npm ERR! node-pre-gyp info using node@16.15.0 | win32 | x64 npm ERR! node-pre-gyp WARN Using needle for node-pre-gyp https download npm ERR! node-pre-gyp info check checked for "C:\Users\지은\Downloads\boilerplate-mern-stack-master\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node" (not found) npm ERR! node-pre-gyp http GET https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp http 404 https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz npm ERR! node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.8 and node@16.15.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp) npm ERR! node-pre-gyp http 404 status code downloading tarball https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-win32-x64-unknown.tar.gz npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.0.0 npm ERR! gyp info using node@16.15.0 | win32 | x64 npm ERR! gyp info ok npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.0.0 npm ERR! gyp info using node@16.15.0 | win32 | x64 npm ERR! gyp ERR! find Python npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON npm ERR! gyp ERR! find Python checking if "python3" can be used npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error npm ERR! gyp ERR! find Python checking if "python" can be used npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python39\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python39\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python39\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python39-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python39-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python38\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python38\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python38\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python38-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python38-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python37\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python37\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python37\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python37-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python37-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python36\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python36\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python36\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Users\지은\AppData\Local\Programs\Python\Python36-32\python.exe npm ERR! gyp ERR! find Python - "C:\Users\지은\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files\Python36-32\python.exe" could not be run npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be run npm ERR! C:\Users\지은\AppData\Local\npm-cache\_logs\2022-05-25T05_57_34_949Z-debug-0.log 루트 디렉토리에서 npm install 오류가 계속뜹니다ㅠ 버전의 문제인가요...? 이 강의 꼭 듣고싶은데 해결방법이 있을까요..?
강의 내용중, Order 도메인을 작성할때 다음 스크린샷처럼 Member, Delivery 엔티티를 사용하여 this 키워드를 사용할때 Cannot access jpabook.jpashop.domain.Member 에러가 나고 있습니다. Member와 Delivery, Order 는 모두 예시로 올려주신 코드와 확인하여 똑같이 작성한걸 확인했지만 혹시 몰라 제가 작성한 코드를 같이 올리겠습니다. package jpabook.jpashop.domain; import lombok.Getter; import lombok.Setter; import javax.persistence.*; import java.util.ArrayList; import java.util.List; @Entity @Getter @Setter public class Member { @Id @GeneratedValue @Column(name = "member_id") private Long id; private String name; @Embedded private Address address; @OneToMany(mappedBy = "member") private List<Order> orders = new ArrayList<>(); } package jpabook.jpashop.domain; import lombok.Getter; import lombok.Setter; import javax.persistence.*; @Entity @Getter @Setter public class Delivery { @Id @GeneratedValue @Column(name = "delivery_id") private Long id; @OneToOne(mappedBy = "delivery", fetch = FetchType.LAZY) private Order order; @Embedded private Address address; @Enumerated(EnumType.STRING) private DeliveryStatus deliveryStatus; } package jpabook.jpashop.domain; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import javax.persistence.*; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import static javax.persistence.FetchType.*; @Entity @Table(name="orders") @Getter @Setter @NoArgsConstructor(access = AccessLevel.PROTECTED) // 이거는 한 도메인 안에서 생성 메서드 등을 통해 로직을 구현했을 경우에 // 접근을 막기위해 사용한다 // 누구는 여기 만들어진 createOrder 를 통해서 주문을 생성하고 // 누구는 Order order = new Order -> order.setOrder로 생성하고 하면 나중에 골치아파치므로 // 애초에 public 으로 지정되어 있지 않은거 + 롬복통한 getter setter 를 통한 코딩을 막아준다 public class Order { @Id @GeneratedValue @Column(name = "order_id") private Long id; @ManyToOne (fetch = LAZY) @JoinColumn(name="member_id") private Member member; @OneToMany(mappedBy = "order", cascade = CascadeType.ALL) // cascade all 걸어주면 private List<OrderItem> orderItems = new ArrayList<>(); // persist(orderItemA) // persist(orderItemB) // persist(orderItemC) // persist(order) 를 cascase all 안걸어주면 이렇게 넣어야하는데 // 걸어주면 persist(order)하면 자동적으로 다 넣어줌 딜리트도 마찬가지로 다 같이 지워줌 // 즉, 원래는 order 에 들어가는 delivery 나 orderItems 등은 다른 테이블에 같이 걸려있잖아 그걸 // 일일히 다 테이블마다 찾아가서 넣어줘야하는데 cascade all 걸어주면 알아서 그걸 다 연동해서 cd 해줌 @OneToOne (fetch = FetchType.LAZY, cascade = CascadeType.ALL) @JoinColumn(name="delivery_id") private Delivery delivery; private LocalDateTime orderDate; @Enumerated(EnumType.STRING) private OrderStatus status; // 주문상태 order cancel //연관관계 편의 메서드 = 양방향일때 쓰면 편한 메소드 //이게 뭐냐면 연관관계 맺어줬으면 DB딴에서는 이런거 안해줘도 다 알아서 동작하긴 하는데 // 비지니스 로직상에서는 이렇게 set할수 있는 연관관계 메서드가 있어야 구현할때 편함 public void setMember(Member member){ this.member = member; member.getOrders().add(this); } public void addOrderItem(OrderItem orderItem){ orderItems.add(orderItem); orderItem.setOrder(this); } public void setDelivery(Delivery delivery){ this.delivery=delivery; delivery.setOrder(this); } //연관관계 메서드 위치는 컨트롤하는쪽에 위치하는게 좋음 비지니스 로직에 의하면 // public static void main (String[] args){ // Member m = new Member(); // Order o = new Order(); // // m.getOrders().add(o); --> 이거 할필요가 없어짐 // o.setMember(m); // } // 원래는 연관관계 메서드가 없으면 이렇게 일일히 비지니스 로직딴에서 데이터 객체 생성후 member 에도 넣어주고 order 에도 넣어주고 해야하는데 // 연관관계 메서드를 만들어 놓으면 로직딴에서 저짓할필요가 없이 편해짐 // ... 은 가변파라미터, String 이라 치면 몇개를 넣어도 다 카바 가능 -> list = 가변파라미터 하면 다 리스트에 들어감 차곡차곡 //생성메서드 public static Order createOrder(Member member, Delivery delivery, OrderItem... orderItems){ Order order = new Order(); order.setMember(member); order.setDelivery(delivery); for (OrderItem orderItem:orderItems) { order.addOrderItem(orderItem); } order.setStatus(OrderStatus.ORDER); order.setOrderDate(LocalDateTime.now()); return order; } //비지니스 로직 //주문취소 public void cancel(){ if(delivery.getDeliveryStatus()==DeliveryStatus.COMP){ throw new IllegalStateException("배송 완료된 상품은 취소불가"); } this.setStatus(OrderStatus.CANCEL); for(OrderItem orderItem:orderItems){ orderItem.cancel(); } } //전체주문가격 조회 public int getTotalPrice(){ int totalprice = 0; for(OrderItem orderItem:orderitems){ totalprice += orderItem.getTotalPrice(); } return totalprice; } } import 구문을 직접 작성하여 엔티티들을 직접 임포트까지 해보고, 로직상에서 아예 jpabook.jpashop.~~ 처럼 직접 임포트 구문을 작성해서 시도도 해보았지만 해결이 되지 않아 질문을 올리게 되었습니다. 확인부탁드립니다.