안녕하세요 본 강의 후반부에 있던 CascadeType.REMOVE와 엔티티의 Detached로의 상태변화 관련 질문 드립니다! 1. 강의상에 출력된 sql 콘솔 출력 화면을 보니 Post 타입 오브젝트를 remove할 경우 자식 오브젝트 Comment 들에 대한 delete 쿼리가 (총 두번)실행 되었음을 알 수 있습니다. 보통 DDL에서 fk를 생성할 때 ON DELETE CASCADE와 같이 하여 부모 로우가 삭제될 경우 이를 참조하는 자식 로우도 삭제하게 할 수 있는 것으로 알고 있습니다. 명시적으로 DELETE 쿼리가 실행되는 것으로 보아 CasecadeType.REMOVE의 경우는 위 단락에서 말씀드린 fk 제약조건과는 다른 방법으로 보입니다. 제 생각(위 두 방법이 다른것인지)이 맞는지 그리고 CascadeType.REMOVE 방식과 같이 DB가 아닌 EntityManager가 관계를 제어?하게 하는 방법의 이점이 따로 있는 것인지 질문드립니다! 2. DETACHED : 강의에서 트랜잭션이 끝나서 Session 밖으로 나왔을때 엔티티의 상태가 DETACHED 상태가 된다고 하셨습니다. 또한 강의 노트상에 Persistent상태에서 Detached 상태로의 전이는 Session.evict(), close() 등의 메서드가 호출되어야 된다고 되어있습니다. 이 두가지로부터 궁금증이 생겨 질문드립니다. 엔티티상태가 Detached가 되는 것이 1)하이버네이트 EntityManager(Session)가 직접(내부적으로) TransactionManager 타입 오브젝트를 이용하거나해서 트랜잭션을 관리 후 Session.evict()와 같은 메서드를 호출하는 방식으로 자동으로 상태가 변화되는 것인지 아니면, 2) (스프링 데이터 JPA가 아닌 하이버네이트만 사용하는 상황에서) 개발자가 트랜잭션이 필요하면 TransactionManager를 사용하고 commit() 되었다면 그 때에 직접 Session.evict()를 호출해야하는 것인지가 궁금합니다. 강사님께서 서비스와 리파지토리 레이어에 대해서도 말씀하셨습니다. 이로부터 서비스 메서드 레벨 단위로 트랜잭션이 진행되는 경우를 생각해보았습니다. 위와 같이 트랜잭션이 서비스 메서드 단위로 진행될 경우 1)의 방법보다 2)이 방법으로 진행되는 것이 더 맞는 것 같지만 강의상에서는 (제가 이해하기로는)상태 변화가 저절로 되는 것 같이 이해가 되어 정확히 알고자 질문드립니다! 답변 부탁드리겠습니다. 감사합니다!
elem.childNodes 중 특정 class를 찾는건 어떻게 하나요?? elem.childNodes.classList.contains('class'); 로 하면 못찾는거같더라구요 for(let i = 0; i < elem.childNodes.length; i++) { elem.childNodes.classList.contains('class'); } 도 안되고,, 어렵네욤,,,
routes/index.js 파일에서 const { User } = require('../models') 이렇게 불러와서 User.findAll()을 하잖아요? 제가 User에 뭐가 들어있는지 몰라서 콘솔을 찍어봤더니 웹스톰 터미널에 아래와 같이 찍혔습니다. class extends Model {} 그래서 User에 들어있는 값이 정확히 무엇인지 모르겠습니다ㅠㅠ 비구조화 할당으로 받는거보니 객체인거같긴한데... 무엇이 들어있는건가요? 그리고 User.findAll()하면 유저에 대한 테이블에 있는 정보가 배열로 불러와지나요? 불러온 정보가 .then 내부의 users 매개변수로 들어가는 것은 이해를 했는데 이전 과정이 살짝 이해가 안갔습니다!
17분에는 child 클래스가 생성될때는 내부적으로 마더클래스의 생성자를 같이 호출해요 라고 말씀하셨고 14분 37초경에는 차일드 클래스를 생성할때 m_i가 메모리가 없다고 하셨는데 이해가 되지 않아서 질문을 드리고자 합니다. 17분에서는 child 클래스가 생성될때 내부적으로 마더클래스 생성자를 같이 호출하니까 m_i가 메모리가 생겨야 하는거 아닌가요? 이 부분에서 갑자기 혼란이 와서 여쭙고 싶습니다.
엄청 중요한건 아니고 20페이지, 21페이지에서 struct timeval *tv 파라미터 설명에서 20페이지 time에서는 현재까지 지난 '초'라고 딱 와닿았는데 21페이지에는 '시간'이라고 나와있어서 살짝 헷갈렸어서, '초' 혹은 ms, us로가 더 낫지 않을까 해서 남겨봅니다....
죄송한데 좀 부탁드리겟습니다. #include <stdio.h> int sum(int a,int b) { int res =a+b; return res; } int min(int a,int b,int c) { int jun =a*b/c; return jun; } int box(int j) { int g; { for (int j=0;j<5;j++) printf("*"); } return g; } int main(void) { int a=10; int b=30; int c=100; int j=0; int box; int g; int res; int jun; res=sum (a,b); printf("res:%d\n",res); jun=min(a,b,c); printf("jun:%d\n",jun); g=box (j); printf("g:%c\n",g); return 0; } 나머지는 다 되는데 int box(j)함수가 숫자가 아니여서 그런가? 별이 출력이 안된네여ㅠㅠ
아마 이 에러가 날겁니다. ERROR: Client does not support authentication protocol requested by server; consider upgrading MySQL client 스텍오버플로에서 찾아본결과 워크밴치에서 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '스키마password' 실행시키시면 에러없이 진행 가능하실거에요.
rror: Cannot find module './build/Release/scrypt' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15) at Function.Module._load (internal/modules/cjs/loader.js:508:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (C:\Users\한현구\addition-game-starter\node_modules\scrypt\index.js:3:20) at Module._compile (internal/modules/cjs/loader.js:701:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at Function.Module._load (internal/modules/cjs/loader.js:531:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (C:\Users\한현구\addition-game-starter\node_modules\scrypt.js\node.js:1:14) at Module._compile (internal/modules/cjs/loader.js:701:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at Function.Module._load (internal/modules/cjs/loader.js:531:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (C:\Users\한현구\addition-game-starter\node_modules\connect-privkey-to-provider\node_modules\caver-js\packages\caver-klay\caver-klay-accounts\src\index.js:34:16) at Module._compile (internal/modules/cjs/loader.js:701:30) --------------------------------------------- npm install npm WARN acorn-dynamic-import@4.0.0 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself. npm WARN requestretry@2.0.2 requires a peer of request@~2.87.0 but none is installed. You must install peer dependencies yourself. 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":"x64"}) npm install 부분도 잘 되었고 truffle.js 와 2_deploy_contracts.js 도 혹시 오타가 있을까 강의 파일을 복사해서 해봤는데 자꾸 저렇게 뜨는데 어떤 문제인가요 private_key 는 제 비밀키로 잘 설정했고 node v : 10.15.3 npm v : 6.4.1 truffle v : 4.1.15