묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨자바 ORM 표준 JPA 프로그래밍 - 기본편
Join 관련 테이블에 데이터 미반영 관련 질문드립니다
아래 코드와같이 Inheritance strategy 설정 및 @DiscriminatiorColum 에노테이션을 추가하였습니다(1) DB 결과를 보면 movie 테이블에 똑같은 데이터가 2번 저장됩니다("Create")임에도 불구하고(2) movie.setDirector 등 관련 설정 데이터가 들어가지 않습니다(3) DType 테이블이 생성되지 않습니다어떠한 이유 때문에 이문제가 발생하는지 잘 모르겠습니다@Entity @Inheritance(strategy = InheritanceType.JOINED) @DiscriminatorColumn public class Item { @Id @GeneratedValue private Long id; private String name; private int price; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getPrice() { return price; } public void setPrice(int price) { this.price = price; } } package helloJpa; import javax.persistence.Entity; @Entity public class Movie extends Item{ private String director; private String actor; public String getDirector() { return director; } public void setDirector(String director) { this.director = director; } public String getActor() { return actor; } public void setActor(String actor) { this.actor = actor; } } public class JpaMain { public static void main(String[] args) { EntityManagerFactory emf = Persistence.createEntityManagerFactory("hello"); EntityManager em = emf.createEntityManager(); EntityTransaction tx = em.getTransaction(); tx.begin(); try{ Movie movie = new Movie(); movie.setDirector("Kim"); movie.setActor("Brandon Grace"); movie.setName("Saga of Wings"); movie.setPrice(10000); em.persist(movie); em.flush(); em.clear(); Movie findMovie = em.find(Movie.class, movie.getId()); System.out.println("findMovie =" + findMovie); tx.commit(); } catch (Exception e) { tx.rollback(); } finally { em.close(); } emf.close(); } } `DB`
-
미해결생산성을 향상시키는 스프링부트 기반의 API 템플릿 프로젝트 구현
tokenClaims에서 memberId를 가져올때
안녕하세요 tokenClaims에서 memberId를 가져올 때Long memberId = Long.valueOf((Integer) tokenClaims.get("memberId"));이렇게 Integer로 형변환후 Long.valueOf로 Long으로 바꿔주시고 계시는데요 Long memberId = (Long) tokenClaims.get("memberId");이런식으로 바로 Long으로 형변환을 시켜 준다면 어떤문제가 생기나요??
-
해결됨실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
POST 요청시 메서드로 들어오는 BookForm 객체의 생성 주체가 누구인가요?
안녕하세요.코드를 읽어보며 흐름을 파악하다가 궁금증이 생겨 질문 드립니다. public class ItemController { @GetMapping("/items/new") public String createForm(Model model) { model.addAttribute("form", new BookForm()); return "items/createItemForm"; } @PostMapping("/items/new") public String create(BookForm form) { ... 생략 } /items/new에 GET으로 접근하면, createForm()이 호출되어 BookForm 객체가 생성되고, Model 객체를 통해 viewResolver로 넘어가는 로직은 이해가 됩니다. 그러나 POST 요청을 보내면, create()가 호출되어 BookForm 객체를 인자로 받는데요.이때, 인자로 들어온 BookForm 객체는 GET 요청시 보내준 BookForm 객체와 다른 객체더라구요. 아마 누군가가 HTML input 태그에 입력된 값을 BookForm 객체로 변환시켜 넣어주는 것 같은데요. 누가 이 책임을 갖고, 어떻게 데이터를 객체로 변환시키는지 그 흐름이 궁금합니다. 마치 @ResponseBody에서 HttpMessageConverter가 객체를 JSON으로 변환시켜준 것처럼이번에도 스프링이 HttpMessageConverter를 통해 HTML input 데이터를 객체로 변환시켜 Controller에게 반환시켜 주는 걸까요? 감사합니다.
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
실행안됨
사진과 같이 코드를 실행할 수가 없습니다...Run 버튼과 public class HelloController가 비활성화 되어있는데 왜인지 궁금합니다...다른 index나 hello.html은 선생님의 코드와 똑같이 적었습니다!
-
해결됨ASP.NET core Blazor 디테일 강의 - 초급편
프로젝트 기본 구조
blazor가 실행되면 어떤 식으로 동작하는지에 대해 고민하다가 궁금한 점이 생겨 질문 남깁니다.실행되면 program.cs를 거쳐 host.cshtml로 가게되는데 이게 루트페이지로서 페이지 처음 요청하면 이 페이지가 반환된다는데 이 페이지의 역할이 뭔지 모르겠습니다.이 호스트 페이지는 루트 App 구성 요소(App.razor)가 렌더링되는 위치를 지정합니다. 라고 하는데 이게 무슨의미인지 모르겠습니다.App.razor 에서 Router 컴포넌트를 사용해 브라우저 탐색을 가로채서 (intercept) 요청된 주소와 일치하는 페이지를 렌더링 한다는데 intercept한다는게 무슨 의미인지 잘 모르겠습니다.
-
미해결블록체인 이더리움 Dapp 개발에 하드햇과 오픈제펠린 활용하기
sample-script.js는 hardhat설치시 자동으로 생성되나요?
sample-script.js는 hardhat설치시 자동으로 생성되나요?저는 생성되어있지 않네요ㅠㅠ
-
미해결HTML+CSS+JS 포트폴리오 실전 퍼블리싱(시즌1)
.content가왼쪽에서 오른쪽으로 이동할때
완성본 미리보기 처럼 원래 있던 자리에서 이동되는 것을 보고 싶은데.text 떄문에 overflow hidden을 줘 버리면 볼수가 없게 되요혹시 .text를 그대로 유지하면서 완성본 미리보기처럼 만들수 있는 방법은 없을까요
-
미해결15일간의 빅데이터 파일럿 프로젝트
클라우데라 매니저를 사용하는 이유
인프런에서 하둡 강의를 검색하면 나오시는 다른 강사분께서는 "클라우데라 매니저를 사용하지 않고 직접 하둡을 설치해서 강의를 진행하고 싶었다" 라고 말씀하시는데 문득 이유가 궁금해져서요, 강의를 보면서 느낀바로는 클라우데라 매니저는 하둡 생태계를 효율적으로 구성하기 위해서 관련된 툴(라이브러리? 오픈소스? 프레임워크? 뭐라고 해야할까요)들을 한곳에서 설치할 수 있게 제공하는 것으로 이해했는데요, 무조건 클라우데라 매니저를 사용하는 것이 편리할 것 같은데 직접 하둡을 설치하는것의 이점이 있나요?
-
미해결15일간의 빅데이터 파일럿 프로젝트
카프카 비동기 전송
플럼에서 수집한 데이터를 카프카 싱크 컴포넌트를 이용해 저장소에 비동기 전송한다는 말은 장애상황에서 저장소에 데이터가 들어가지 못하고 있을때 카프카의 버퍼에서 갖고있다는 말인가요? (비동기 전송 = 데이터의 발생과 적재가 동시에 이루어지지 않는다)
-
미해결
Running TagUI RPA as a Lambda Function
I am trying to run a simple TagUI flow as a Lambda function using container images. I have made a Dockerfile using the bootstrap and function.sh from this tutorial:FROM amazon/aws-lambda-provided:al2 When using RPA Architecture (<a href="https://hkrtrainings.com/rpa-architecture" title="rpa-architecture" alt="rpa-architecture">rpa-architecture</a>) RUN yum install -y wget nano php java-1.8.0-openjdk unzip procps RUN curl https://intoli.com/install-google-chrome.sh | bash RUN wget https://github.com/kelaberetiv/TagUI/releases/download/v6.46.0/TagUI_Linux.zip \ && unzip TagUI_Linux.zip \ && rm TagUI_Linux.zip \ && ln -sf /var/task/tagui/src/tagui /usr/local/bin/tagui \ && tagui update RUN sed -i 's/no_sandbox_switch=""/no_sandbox_switch="--no-sandbox"/' /var/task/tagui/src/tagui ADD tr.tag /var/task/tagui/src/tr.tag WORKDIR /var/runtime/ COPY bootstrap bootstrap RUN chmod 755 bootstrap WORKDIR /var/task/ COPY function.sh function.sh RUN chmod 755 function.sh CMD [ "function.sh.handler" ] My function.sh:function handler () { cp -r /var/task/tagui/src/* /tmp; chmod 755 /tmp/tagui; OUTPUT=$(/tmp/tagui /tmp/tr.tag -h); echo "${OUTPUT}"; } Notes:the sed line is required to get TagUI running in docker images.tr.tag is just a simple flow to do a password reset on a webapp so I can confirm the container has run.everything has to be run in /tmp as that is the only folder Lambda can write to in the container and TagUI creates a load of temporary files during execution.When I run as a Lambda I get the error:./tmp/tagui/src/tagui: line 398: 56 Trace/breakpoint trap (core dumped) $chrome_command --user-data-dir="$TAGUI_DIR/chrome/tagui_user_profile" $chrome_switches $window_size $headless_switch $no_sandbox_switch > /dev/null 2>&1When I run the container from Docker it runs perfectly. I have tried increasing both the memory and timeout of the function.The end goal I am trying to achieve is to have a Lambda function triggered by an API gateway that can receive a TagUI RPA flow and run it.
-
미해결Python 엑셀 프로그래밍 - with xlsxwriter
invalid index to scalar variable 오류 발생 해결법 알려주세요
시나리오 튜토리얼 강의에서 나이를 계산하는 코딩 중에 항상 에러가 발생합니다. 어떻게 해결해야할지 알려주세요 age를 정의하는 데서 발생하는데요아래와 같이 하면 스칼라 에러가, 커멘트 아웃한 라인으로바꾸면 인덱스 에러가 발생합니다. IndexError: invalid index to scalar variable.from datetime import datetime year = datetime.today().year print(year) 나이 = [] for i in range(len(생년월일)): age = year - int(생년월일[i][0:4]) # age = year - int(생년월일[i][0:생년월일[i].index('년')]) 나이.append(age) 나이
-
미해결[개념은 호옹~, 실습 빡] SQL 데이터 분석, 입문!
연습문제 정답
연습문제 정답에 대한 코드는 어딨는지 알 수 있을까요?
-
해결됨실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
setUsername 관련 질문
흠..멤버레퍼지토리 클래스에사용하고 있는 세터 메서드 이름이setUsername() 입니다.수동으로 setName()으로 바꿀까요?아니면 Member 클래스에 name변수를 username으로 바꿀까요?
-
미해결[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
rtc api 오류 해결 부탁드려여~~
처음부터 끝까지 그대로 따라쳤는데 Widget renderSubView(){ if(otherUid == null){ return Center( child: Text('채널에 유저가 없습니다.'), ); }else{ return RtcRemoteView.SurfaceView( uid: otherUid!, channelId: CHANNEL_NAME, ); } }이부분을 넣을 때부터 에러 메시지가 나옵니다. 코드의 오류가 있는지 확인해보려고 강사님 깃허브를 통째로 복사해서 돌려보았는데도 똑같이 에러가 나네요 ㅠㅠ구글을 검색해도 어떤 에러인지 알수가 없는데 대략 어떤부분을 봐야할지 알려주시면 감사하겠습니다. W/libc ( 6554): Access denied finding property "net.dns1"W/libc ( 6554): Access denied finding property "net.dns2"W/libc ( 6554): Access denied finding property "net.dns3"W/libc ( 6554): Access denied finding property "net.dns4"W/GENP.0 ( 6554): type=1400 audit(0.0:1319): avc: denied { read } for name="temp" dev="sysfs" ino=17334 scontext=u:r:untrusted_app:s0:c149,c256,c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0 app=com.example.videochatW/GENP.0 ( 6554): type=1400 audit(0.0:1320): avc: denied { read } for name="temp" dev="sysfs" ino=17334 scontext=u:r:untrusted_app:s0:c149,c256,c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0 app=com.example.videochatW/libc ( 6554): Access denied finding property "net.dns1"W/libc ( 6554): Access denied finding property "net.dns2"W/libc ( 6554): Access denied finding property "net.dns3"W/libc ( 6554): Access denied finding property "net.dns4"W/GENP.0 ( 6554): type=1400 audit(0.0:1321): avc: denied { read } for name="temp" dev="sysfs" ino=17334 scontext=u:r:untrusted_app:s0:c149,c256,c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0 app=com.example.videochatW/GENP.0 ( 6554): type=1400 audit(0.0:1322): avc: denied { read } for name="temp" dev="sysfs" ino=17334 scontext=u:r:untrusted_app:s0:c149,c256,c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0 app=com.example.videochatW/libc ( 6554): Access denied finding property "net.dns1"W/libc ( 6554): Access denied finding property "net.dns2"W/libc ( 6554): Access denied finding property "net.dns3"W/libc ( 6554): Access denied finding property "net.dns4"W/GENP.0 ( 6554): type=1400 audit(0.0:1323): avc: denied { read } for name="temp" dev="sysfs" ino=17334 scontext=u:r:untrusted_app:s0:c149,c256,c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0 app=com.example.videochatW/GENP.0 ( 6554): type=1400 audit(0.0:1324): avc: denied { read } for name="temp" dev="sysfs" ino=17334 scontext=u:r:untrusted_app:s0:c149,c256,c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0 app=com.example.videochatW/libc ( 6554): Access denied finding property "net.dns1"W/libc ( 6554): Access denied finding property "net.dns2"W/libc ( 6554): Access denied finding property "net.dns3"W/libc ( 6554): Access denied finding property "net.dns4"W/GENP.0 ( 6554): type=1400 audit(0.0:1325): avc: denied { read } for name="temp" dev="sysfs" ino=17334 scontext=u:r:untrusted_app:s0:c149,c256,c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=0 app=com.example.videochat
-
미해결Vue.js 중급 강좌 - 웹앱 제작으로 배워보는 Vue.js, ES6, Vuex
깃허브 권한 요청드립니다.
인프런 아이디 : seonok.chae@kt.com인프런 이메일 : seonok.chae@kt.com깃헙 아이디 : sochae78@gmail.com깃헙 Username : sochae
-
해결됨그림으로 쉽게 배우는 운영체제
예제코드 질문
안녕하세요. 어떤분이 정정하신 부분에 대해서 질문하신 글 답변보고 질문드립니다.인터넷 브라우저가 종료되면 브라우저 프로그램의 코드 내에서 exit()가 호출되기 때문에, 해당 예제코드의 13번 라인에 exit()함수는 호출되지 않는다는 건가요?그렇다면 13번 exit()를 지워도 되는건가요?
-
미해결실전! 코틀린과 스프링 부트로 도서관리 애플리케이션 개발하기 (Java 프로젝트 리팩토링)
assertThat 에 오류 표시가뜹니다.
안녕하세요 ! 강의 6강을 시청 중입니다. assertThat(calculator.number).isEqualTo(8)위 코드를 작성 하였는데 오류가 발생합니다. 일단 assertThat 중에서 AssertProvider를 사용하라고 하셨는데 저는 그런것이 나오지 않습니다. ㅠㅜ. 설정이 잘못 되어 있는걸까요?
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
숨바꼭질4, 숨바꼭질2 질문
강의 1:20 에서 max_n 변수의 값을 처음 위치할 수 있는 값의 범위의 2배로 설정한 것에 설명을 이해할 수 있었습니다.동일한 원리로 『숨바꼭질2』의 해설(https://www.acmicpc.net/source/share/21c1859cbc6e409a93a5e41ac62b5176) 도 max 값을 200,000으로 해줘야하는 것인지 궁금합니다.
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
13:06 return "hello"의 의미
return "hello"는 텍스트인 hello를 반환하는 것 아닌가요??왜 model.addAttribute(data,value) 에서 value 값이 반환되는 것인가요?hello 가 큰따옴표로 묶여 있어서 텍스트를 의미하는 건지, 아니면 GetMapping("hello")에서 hello를 의미하는 것인지 헷갈립니다.
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
코드를 똑같이 작성하였으나 다음과 같은 에러가 발생합니다.
파일 위도 제대로 설정한 것 같은데, 어떤 부분 때문에 다음과 같은 에러가 나는 걸까요??java를 17버전으로 사용해서 생기는 문제일까요?