묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결반응형 웹사이트 포트폴리오(Architecture Agency)
안녕하세요. 제가 CSS Peek을 설치를 했는데, ctrl 하고 코딩 단어에 갔는데, 변하지 않아서 어떻게 해결해야 할까요?
안녕하세요. 제가 CSS Peek을 설치를 했는데, ctrl 하고 코딩 단어에 갔는데, 변하지 않아서 어떻게 해결해야 할까요?
-
해결됨탄탄한 백엔드 NestJS, 기초부터 심화까지
swagger ui error
swagger ui 사용 시 localhost 외 외부에서 접속시 net::ERR_SSL_PROTOCOL_ERROR 에러가 발생합니다 . github issue 문제도 있던데 여기 부분은 어떻게 해결하는지 알고싶습니다. 해당 issue url 입니다 https://github.com/nestjs/swagger/issues/1006
-
미해결자바 ORM 표준 JPA 프로그래밍 - 기본편
간단한 통계 쿼리가 가능한가요?
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(http://bit.ly/3fX6ygx)을 먼저 확인해주세요. 3. 질문 잘하기 메뉴얼(http://bit.ly/2UfeqCG)을 먼저 읽어주세요. 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? 예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예3. 질문 잘하기 메뉴얼을 읽어보셨나요? 아니오 [질문 내용] 영한님 강의 정말 잘보고있습니다. ORM과 JPA 공부중에 질문이 하나 있는데요. 실제 제가 만들고 있는 모델관 다르지만 질문하기 위해 예시를든다면 , 쇼핑몰을 예로 어떤 상품들이 있고 그것에 대한 판매가 이뤄진다고 가정할때 엔티티는 상품, 주문, 결제등이 있을수 있겠죠. 이때 '상품들의 월별 판매량'을 통계 내야 한다고 치고 --------------------------------------- 상품명 1월 2월 3월 4월 5월 ... 합 -------------------------------------- 상품A 20 15 4 7 8 104 상품B 1 1 10 2 1 25 ---------------------------------------- 이런식의 통계 쿼리를 짜야 할경우 JPA로 가능한지? QueryDSL 등을 써서라도 가능한지? 이정도면 복잡한 통계 쿼리는 아니고 많은 서비스에서 빈번하게 발생하는 간단한 통계라고 생각되는데 감이 안잡힙니다. 보통 데이터베이스 쿼리의 결과를 엔티티객체가 받는거는 강의를 통해 익숙한데 통계쿼리의 경우는 여러 테이블의 조인과 다양한 조건들에 대한 결과이고 그 결과도 엔티티가 받는게 아니다 보니까 더 이해가 안됙 ㅗ멘붕오는것 같습니다.
-
미해결스프링 데이터 JPA
복잡한 통계쿼리도 JPA로 가능한가요?
기선님 쉽게 설명해주시는 강의를 보며 참 많은 도움이 되고있습니다. 실제 제가 만들고 있는 모델관 다르지만 질문하기 위해 예시를든다면 , 쇼핑몰을 예로 어떤 상품들이 있고 그것에 대한 판매가 이뤄진다고 가정할때 엔티티는 상품, 주문, 결제등이 있을수 있겠죠. 이때 '상품들의 월별 판매량'을 통계 내야 한다고 치고 --------------------------------------- 상품명 1월 2월 3월 4월 5월 ... 합 -------------------------------------- 상품A 20 15 4 7 8 104 상품B 1 1 10 2 1 25 ---------------------------------------- 이런식의 통계 쿼리를 짜야 할경우 JPA로 가능한지? QueryDSL 등을 써서라도 가능한지? 감이 안잡힙니다.
-
미해결Klaytn 클레이튼 블록체인 어플리케이션 만들기 - 이론과 실습
에러 원인 및 해결 문의
PS C:\Users\Administrator\addition-game-starter> npm install npm WARN deprecated ethereumjs-vm@2.6.0: New package name format for new versions: @ethereumjs/vm. Please update. npm WARN deprecated ethereumjs-block@1.7.1: New package name format for new versions: @ethereumjs/block. Please update. npm WARN deprecated safe-event-emitter@1.0.1: Renamed to @metamask/safe-event-emitter npm WARN deprecated ethereumjs-block@2.2.2: New package name format for new versions: @ethereumjs/block. Please update. npm WARN deprecated ethereumjs-common@1.5.2: New package name format for new versions: @ethereumjs/common. Please update. npm WARN deprecated ethereumjs-tx@2.1.2: New package name format for new versions: @ethereumjs/tx. Please update. > scrypt@6.0.3 preinstall C:\Users\Administrator\addition-game-starter\node_modules\scrypt > node node-scrypt-preinstall.js > secp256k1@4.0.2 install C:\Users\Administrator\addition-game-starter\node_modules\ethereum-cryptography\node_modules\secp256k1 > node-gyp-build || exit 0 C:\Users\Administrator\addition-game-starter\node_modules\ethereum-cryptography\node_modules\secp256k1>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19) gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16) gyp ERR! stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21) gyp ERR! System Windows_NT 10.0.18362 gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\Administrator\addition-game-starter\node_modules\ethereum-cryptography\node_modules\secp256k1 gyp ERR! node -v v10.15.3 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok > keccak@1.4.0 install C:\Users\Administrator\addition-game-starter\node_modules\keccak > npm run rebuild || echo "Keccak bindings compilation fail. Pure JS implementation will be used." > keccak@1.4.0 rebuild C:\Users\Administrator\addition-game-starter\node_modules\keccak > node-gyp rebuild C:\Users\Administrator\addition-game-starter\node_modules\keccak>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19) gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16) gyp ERR! stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21) gyp ERR! System Windows_NT 10.0.18362 gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\Administrator\addition-game-starter\node_modules\keccak gyp ERR! node -v v10.15.3 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! keccak@1.4.0 rebuild: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the keccak@1.4.0 rebuild script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm WARN Local package.json exists, but node_modules missing, did you mean to install? npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2021-09-02T00_51_19_221Z-debug.log "Keccak bindings compilation fail. Pure JS implementation will be used." > scrypt@6.0.3 install C:\Users\Administrator\addition-game-starter\node_modules\scrypt > node-gyp rebuild C:\Users\Administrator\addition-game-starter\node_modules\scrypt>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19) gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16) gyp ERR! stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21) gyp ERR! System Windows_NT 10.0.18362 gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\Administrator\addition-game-starter\node_modules\scrypt gyp ERR! node -v v10.15.3 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm WARN rollback Rolling back readable-stream@2.3.6 failed (this is probably harmless): EPERM: operation not permitted, rmdir 'C:\Users\Administrator\addition-game-starter\node_modules\fsevents\node_modules' npm WARN klay-dapp-boilerplate@0.0.1 No repository field. npm WARN klay-dapp-boilerplate@0.0.1 No license field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"}) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! scrypt@6.0.3 install: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the scrypt@6.0.3 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2021-09-02T00_51_22_575Z-debug.log
-
해결됨코딩은 실전이다! - Git알못을 위한 깃린이코스(Git, Github 실습위주)
슬랙초대 부탁드립니다!!
jehyn923@gmail.com 입니다!
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
프론트에서 REACT 등 사용 시 배포 방법
안녕하세요 영한강사님 좋은강의 항상 감사드립니다. React랑 Springboot랑 병행해서 작업하면 배포할 때 클라이언트 서버, 백앤드 서버를 따로 둬서 두 개로 분리해서 배포하나요? 예를들면 웹페이지 호출 domain = abcd.com react에서 서버 url = qwer.com/jsondata 등등 으로 호출해서 보여주는 방식을 많이쓰나요. 아니면 스프링부트에 react를 합쳐서?가되는지 모르겠지만 백앤드서버에 다같이 배포하나요?
-
미해결Java TPC (생각하고, 표현하고, 코딩하고)
Book b = new Book (); 의 b 관련 질문이 있습니다!
안녕하세요. <관계를 이해하라> 수업 수강 중 질문이 생겨 글을 작성합니다. Book b = new Book (); 에서 저는 b가 객체Book의 번지를 할당받는 참조 변수라고 생각했습니다. 왜 b가 참조변수가 아닌 인스턴스 변수가 되는지에 대한 설명을 부탁드려도 될까요? 찾아봐도 인스턴스변수와 참조변수의 구분을 어떻게 해야 하는 것인지 잘 모르겠어서 결국 질문드립니다. 감사합니다.
-
미해결Axure RP 9,10 - 서비스 기획자를 위한 최적의 프로토타이핑 툴
rp 파일간 병합
언녕하세요. 혹시 다른 rp파일의 페이지를 한번에 혹은 페이지를 직접 복사 할 수 있는 방법안 없을까요??
-
미해결설계독학맛비's 실전 Verilog HDL Season 1 (Clock부터 Internal Memory까지)
FSM 실습응용 질문2
`timescale 1ns / 1ps module simple_bram_ctrl // Param #( parameter DWIDTH = 16, parameter AWIDTH = 12, parameter MEM_SIZE = 3840 ) ( input clk, input reset_n, input i_run, input [AWIDTH-1:0] i_num_cnt, output o_idle, output o_write, output o_read, output o_done, // Memory I/F output[AWIDTH-1:0] addr0, output ce0, output we0, input [DWIDTH-1:0] q0, output[DWIDTH-1:0] d0, // output read value from BRAM output o_valid, output[DWIDTH-1:0] o_mem_data ); 모듈에서 #(parameter DWIDTH = 16, parameter AWIDTH = 12, parameter MEN_SIZE = 3840)으로 선언한 이유가 궁금합니다 테스트벤치에서 인스턴스를 찍을 때 다시 #( .DWIDTH (`DATA_WIDTH), ....) ; 를 써서 테스트벤치안에서 `define으로 선언한 값들(7, 16, 128)을 넣어주는 것 같은데 왜 모듈 선언부위에서 또 parameter를 선언해주신건가요? 또한 DWIDTH = 16, AWIDTH = 12, MEN_SIZE = 3840 의 값들은 그냥 임의로 정해서 넣어주신건가요?
-
미해결Redux vs MobX (둘 다 배우자!)
getDefaultMiddleware 관련 질문드립니다.
안녕하세요 제로초님! 유익한 강의 감사합니다. 다름 아니라, 오늘 getDefaultMiddleware를 써보니까 라이브러리에서 deprecated되어있더라구요. 공식문서(https://redux-toolkit.js.org/api/getDefaultMiddleware)보니까 기존 사용하던 코드에서 어떻게 변경할지 가이드를 제시하고 있는데, 가이드대로 코드 변경해도 문제 없을까요 ??!
-
미해결캐글 Advanced 머신러닝 실전 박치기
Feature engineering 질문입니다
선생님 덕분에 항상 많은것을 배워갑니다. 강의를 들으면서 궁금한게 생겼는데요. LGBM 모델이 decision tree 기반으로 작동한다고 알고있습니다. 첫번째 LGBM regressor 모델을 쓰게될때 categorical 데이터와 연속형 데이터가 섞인 데이터를 받게될 경우도 다분하다고생각되는데요 .이때는 data feature engineering 을 어떤식으로 접근해야할지 모르겠습니다. 조금 범위가 넓은 질문이기도 한데요 1. 가령 연령대의 데이터가 birth_date 로 오지않고 1:(20~25) 2:(25~30) 등으로 올때는 그냥 별도의 feature_engineering 을 하지않아도 되는지??여부 2. 새로운 특징을 추출할때 범주형과 연속형 변수를 섞어서 도출할때에는 어떤식으로 해야할지?? 선생님의 의견을 듣고싶습니다( 가령 안건드는게 좋다라던지 접근방식이라던지) 3. 그리고 연속형 범주에서 LGBM 을 사용할떄는 굳이 정규화를 시켜주지않아도되는지여부도 궁금합니다.( decision tree 기반이라 굳이 안해도 된다는말을 어디서본거같긴한데 잘 모르겠습니다) 4. 특정 열이 데이터가 한쪽으로 치우져있을때 log 를 씌워 정규분포형태로 만들어줄수있다는것도 알게되었습니다(머신러닝완벽가이드) 여기서 train_data의 특정 column에('A'라고 하겠습니다) log를 적어주었을때 test_column 특정열('A')에도 log 를 취해준후 예측을 하고 predict 한결과를 그대로 사용하면 되는것이 맞는지요?? 5. 마지막으로 평가지표에 대한 질문인데요. rmse나 MAPE 등 다양한 평가지표가 존재합니다. 근데 여기서 rmse 가 무조건낮다고 쓸만한 모델인가? 에대한질문입니다. rmse 가 0.1 이여도 쓸만한 모델이 아닐수도있고 rmse가 10이여도 쓸만한 모델일수도 있다고 생각이되는데 이에대한 구분기준은 어떻게정해야할까요??? 이제 머신러닝을 배우는단계라 궁금한게 너무많아서 한번에 질문이 많아졌네요. 감사합니다.
-
미해결홍정모의 게임 만들기 연습 문제 패키지
vcpkg 다운로드에 문제를 겪고있습니다
현재 vcpkg를 통하여 opengl, glew, glfw3를 32비트와 64비트 모두를 선생님의 chapter가 있는 곳에 전부 다운받아 놓은 상태입니다. chapter1 - lecture1.sln을 통하여 코드를 실행하였더니 "파일소스를 열 수 없습니다 "GLFW/glfw3.h" 이렇게 에러가 나는데 어떻게 하면 해결 할 수 있을까요?
-
미해결프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)
예제 8번 관련 질문입니다
8번이 실행되는 원리는 어느정도 이해가 가서 변형을 해보았습니다. 수업에서 다루었던 코드가 a = ['foo', 'bar', 'baz'] while True: if not a: break print(a.pop()) 인데 이것을 아래와 같이 바꾸면 에러가 뜹니다. a = ['foo', 'bar', 'baz'] while True: if a == False: break else: print(a.pop()) if not a:가 a가 false가 되면으로 해석해서 저렇게 바꿔봤는데 에러로 IndexError: pop from empty list 가 뜨는 이유를 모르겠습니다. 답변 부탁드립니다.
-
미해결유니티(Unity)로 시작하는 게임개발: Part 3. 슈팅게임 개발
Delegate를 옮길때
GameData.cs에다가 public delegate void OnClicked();를 옮길때, 제가 실수로 Util 클래스 안에다가 넣어버렸습니다 그랬더니, 아래 함수에서 " popUp.SetListenerYes(onClickYes); popUp.SetListenerNo(onClickNo);" 이 부분에서 onClickNo라고 되어 있는 부분에서 오류가 납니다 위의 Argument 자리에서는 괜찮은데 왜 아래서 오류가 생기는 건지 이해가 안갑니다 오류는 이러합니다 " public delegate void OnClicked(); " public static void CreatePopUp(GameObject prefab, GameObject parent, OnClicked onClickYes, OnClicked onClickNo, int id) { GameObject GO_PopUp = GameObject.Instantiate<GameObject>(prefab, parent.transform, false); PopUp popUp = GO_PopUp.GetComponent<PopUp>(); popUp.SetListenerYes(onClickYes); popUp.SetListenerNo(onClickNo); popUp.Text_PopUpContent.text = string.Format("Do you want to buy {0}", GameDataManager.instance.ships[id].name); }
-
해결됨설계독학맛비's 실전 FPGA를 이용한 HW 가속기 설계 (LED 제어부터 Fully Connected Layer 가속기 설계까지)
delay 질문.
안녕하세요 맛비님! 뭔가 재 질문하게 되는거 같아 죄송합니다.. r_vaild 신호를 이용해서 delay가 되는 원리가 이해가 되지 않습니다.. always @(posedge clk or negedge reset_n) begin if(!reset_n) begin r_vaild <= 1'b0; end else if (i_run) begin r_vaild <= 1'b0; end else begin r_vaild <= i_vaild; end end 이 구문에서 i_vaild 라는 저장공간에 있는 값을 r_vaild 라는 저장공간으로 이동하게 되면 delay가 발생하는 원리가 맞나요?? 즉, 저장공간에서 저장공간으로 값이 이동하게 되면 delay 가 생긴다.. 제대로 이해한게 맞을까요??
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
getServerSideProps 를 이용하면 store 가 초기화돼요.
main posts 들이 보이는 index.js 에서 getServerSideProps 를 통해 초기 post 들을 불러오고 있는데, Link 태그를 이용해서 게시글 상세 페이지 ex) /post/39 와 같이 이동하게 만들었습니다. 그 이후 '뒤로 가기' 하면 index.js 를 불러오면서 새롭게 main posts 를 불러오는데 혹시 그전 값들로 유지하게 할 수 있나요?
-
미해결자바(Java) 알고리즘 문제풀이 입문: 코딩테스트 대비
시간 초과
코드는 강의에 올려주신 것과 비슷한데 시간 초과가 발생합니다... import java.util.*; public class Ch8_14 { public static int n,m, dis, answer = Integer.MAX_VALUE; public static int[][] board; public static ArrayList<Point> pizza = new ArrayList<>(); public static ArrayList<Point> house = new ArrayList<>(); public static int[] combi; public static class Point { int x, y; Point(int x, int y) { this.x = x; this.y = y; } } public static void DFS(int index, int start) { if(index == m) { int sum = 0; for(Point h : house) { dis=Integer.MAX_VALUE; for (int idx : combi) { dis = Math.min(dis, Math.abs(h.x - pizza.get(idx).x) + Math.abs(h.y - pizza.get(idx).y)); } sum+=dis; } answer = Math.min(answer, sum); } else { for(int i = start; i < pizza.size(); i++) { combi[index] = i; DFS(index+1, start+1); } } } public static void main(String[] args) { Scanner sc = new Scanner(System.in); n = sc.nextInt(); m = sc.nextInt(); board = new int[n][n]; // 입력 받기 for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { int tmp = sc.nextInt(); if(tmp == 1) house.add(new Point(i,j)); if(tmp == 2) pizza.add(new Point(i,j)); } } combi = new int[m]; DFS(0,0); System.out.println(answer); } }
-
미해결
php localhost:8080
강의 따라가고 있는데 localhost:8080으로 접속하는게 안됩니다 . 인터넷에서 찾았을땐 netstat -aon 으로 8080사용중인 서버를 종료하고 하면 된다는데 같은 php파일이 사용되는걸로 되어있고 종료하고 진행해도 계속 같습니다 어떻게 해야할까요
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
테이블 설계 관련 질문
프론트 엔드에서 전체 category를 조회해서, 화면에 카테고리를 선택할수 있도록 출력해주는 화면이 있고 유저가 게시글을 등록한다고 한다면 --- 1. 아래와 같이 Category 테이블에 모든 카테고리를 저장해 (init), 2. 이 리스트를 전달해주고, (미리 카테고리들은 정해져 있다고 할때, 추가도 할수 있겠지만) 3. user가 게시글을 등록할때 client가 입력한 category를 category table에서 찾아오고 4. 그 값을 기반으로 post와 postCategory에 저장해주는 방식이 되어야 하는거 같은데 (강의들중 어디에서 질문하는게 좋을지 약간 애매해서 여기에 글 올립니다.) ------ 이렇게 하는 방식이 맞을까요? 뭔가 동작 하게끔 할수 는 있는데 올바른 방법같지 않아서 영한님 다른강의들도 들어보면서 같이 몇일째 고민중인데 찜찜하고 명확하게 확신이 안섭니다. 카테고리 목록은 initService를 하나 만들어서 미리 저장해두었습니다. (강의에서 하신 initDb처럼) 답변주시면 감사드리겠습니다. 몇일째 해결이 안되요 ㅠㅠ post테이블의 CATEGORY_TAG는 삭제 예정입니다 public class Post { @Id @GeneratedValue @Column(name = "post_id") private Long id; private String title; @Lob private String desc; private int price; @Enumerated(EnumType.STRING) private Status status; @ManyToOne @JoinColumn(name = "account_id") private Account seller; @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name = "post_category_id") private PostCategory postCategory; // old @Enumerated(EnumType.STRING) private CategoryTag categoryTag; /*@OneToOne @JoinColumn(name = "category_id") private Category category;*/ public Post(String title, Account seller){ this.title = title; this.seller = seller; status = Status.NEW; } // old public Post(String title, String desc, int price, CategoryTag categoryTag, Account seller){ this.title = title; this.desc = desc; this.price = price;// @Converter this.categoryTag = categoryTag; this.seller = seller; status = Status.NEW; seller.addPost(this); } public Post(String title, String desc, int price, Account seller){ this.title = title; this.desc = desc; this.price = price;// @Converter this.postCategory = postCategory; this.seller = seller; status = Status.NEW; seller.addPost(this); } //== 연관관계 메서드 ==/ public void setSeller(Account seller) { this.seller = seller; seller.addPost(this); } //== 바즈니스 로직 ==// // old public static Post post(String title, Account seller, CategoryTag categoryTag){ Post post = new Post(title, seller); post.setCategoryTag(categoryTag); return post; } public void setPostCategory(PostCategory postCategory){ this.postCategory = postCategory; postCategory.setPost(this); }} @Entity@Setter@Getterpublic class PostCategory { @Id @GeneratedValue @Column(name = "post_category_id") private Long id; @OneToOne(mappedBy = "postCategory") private Post post; @OneToOne @JoinColumn(name = "category_id") private Category category;} @Entity@Getter@Setter@NoArgsConstructor(access = AccessLevel.PROTECTED)public class Category { @Id @GeneratedValue @Column(name= "category_id") private Long id; @Enumerated(EnumType.STRING) @Column(unique = true) private CategoryTag categoryTag; public Category(CategoryTag categoryTag){ this.categoryTag = categoryTag; }} @PostMapping("/new2")public PostResponseDto postV2(@RequestBody PostRequestDto postRequestDto, @ApiIgnore HttpSession session){ Account account = getSessionCheckedAccount(session); Post post = new Post(postRequestDto.getTitle(), postRequestDto.getDesc(), postRequestDto.getPrice(), account); Category category = categoryJpaRepository.findByCategoryTag(postRequestDto.getCategoryTag()); PostCategory postCategory = new PostCategory(); postCategory.setCategory(category); post.setPostCategory(postCategory); Long postId = postService.post(post); return new PostResponseDto(postId);}