묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결자바 ORM 표준 JPA 프로그래밍 - 기본편
em.clear()의 기능?
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요.package jpabook.jpashop; import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; import jakarta.persistence.EntityTransaction; import jakarta.persistence.Persistence; import jpabook.jpashop.domain.*; import org.hibernate.boot.model.source.spi.IdentifierSource; import javax.swing.text.html.parser.Entity; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; 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{ Address address = new Address("city1", "street1", "10000"); Member member = new Member(); Order order = new Order(); Delivery delivery = new Delivery(); List<Order> orders = new ArrayList<>(); member.setName("raewoo"); member.setAddress(address); order.setMember(member); order.setDelivery(delivery); orders.add(order); member.setOrders(orders); delivery.setOrder(order); delivery.setAddress(address); em.persist(member); em.persist(order); em.persist(delivery); em.flush(); em.clear(); System.out.println("================================"); Address address2 = new Address("city2", "street2", "10000"); Member findMember = em.find(Member.class, member.getId()); Order findOrder = em.find(Order.class, order.getId()); findMember.setAddress(address2); em.flush(); em.clear(); //여기!! System.out.println(findMember.getAddress().getCity()); System.out.println("================================"); System.out.println(findMember.getOrders().getFirst().getDelivery().getAddress().getCity()); tx.commit(); }catch (Exception e){ tx.rollback(); } finally { em.close(); } emf.close(); } }이렇게 메인 메서드를 작성했습니다.//여기!! 라고 주석처리 해놓은 em.clear()가 있으면 콘솔에 아래와 같이 결과가 나오고요,Hibernate: select m1_0.MEMBER_ID, m1_0.city, m1_0.street, m1_0.zipcode, m1_0.CREATED_DATE_TIME, m1_0.name, m1_0.UPDATED_DATE_TIME from Member m1_0 where m1_0.MEMBER_ID=?Hibernate: select o1_0.ORDER_ID, o1_0.CREATED_DATE_TIME, o1_0.DELIVERY_ID, o1_0.MEMBER_ID, o1_0.orderDate, o1_0.status, o1_0.UPDATED_DATE_TIME from ORDERS o1_0 where o1_0.ORDER_ID=?Hibernate: /* update for jpabook.jpashop.domain.Member */update Member set city=?, street=?, zipcode=?, CREATED_DATE_TIME=?, name=?, UPDATED_DATE_TIME=? where MEMBER_ID=?city2================================보시는 바와 같이 마지막 =======을 기준으로 system.out.println() 문이 하나 더 출력되어야하는데, 출력되지 않습니다.하지만 em.clear()를 없애면 ================================Hibernate: select m1_0.MEMBER_ID, m1_0.city, m1_0.street, m1_0.zipcode, m1_0.CREATED_DATE_TIME, m1_0.name, m1_0.UPDATED_DATE_TIME from Member m1_0 where m1_0.MEMBER_ID=?Hibernate: select o1_0.ORDER_ID, o1_0.CREATED_DATE_TIME, o1_0.DELIVERY_ID, o1_0.MEMBER_ID, o1_0.orderDate, o1_0.status, o1_0.UPDATED_DATE_TIME from ORDERS o1_0 where o1_0.ORDER_ID=?Hibernate: /* update for jpabook.jpashop.domain.Member */update Member set city=?, street=?, zipcode=?, CREATED_DATE_TIME=?, name=?, UPDATED_DATE_TIME=? where MEMBER_ID=?city2================================Hibernate: select o1_0.MEMBER_ID, o1_0.ORDER_ID, o1_0.CREATED_DATE_TIME, o1_0.DELIVERY_ID, o1_0.orderDate, o1_0.status, o1_0.UPDATED_DATE_TIME from ORDERS o1_0 where o1_0.MEMBER_ID=?Hibernate: select d1_0.DELIVERY_ID, d1_0.city, d1_0.street, d1_0.zipcode, d1_0.CREATED_DATE_TIME, d1_0.status, d1_0.UPDATED_DATE_TIME from Delivery d1_0 where d1_0.DELIVERY_ID=?Hibernate: select o1_0.ORDER_ID, o1_0.CREATED_DATE_TIME, o1_0.DELIVERY_ID, o1_0.MEMBER_ID, o1_0.orderDate, o1_0.status, o1_0.UPDATED_DATE_TIME from ORDERS o1_0 where o1_0.DELIVERY_ID=?city1이렇게 ORDERS를 조회하는 쿼리문이 나오고, city1이 정상적으로 출력됩니다.em.clear()가 있고 없고에 왜 이런 차이가 발생하는 건가요?쿼리가 나가지 않는다던가, 어떤 null 값을 읽어온다던가 하면 예외가 나오거나, null로 나와야 할텐데, System.out.println()문 자체가 씹히는 건 어떤 경우인가요? 왜 이런건가요?
-
미해결모던 안드로이드 - Jetpack Compose 입문
Navigation수업에서 string대신 bitmap을 인자로 넘겨주는 방법?
네비게이션 수업도중 궁금한 점이 있어서 질문드립니다.ThirdScreen으로 Bitmap데이터를 인자로 넘기고 싶습니다. 어떻게 해야 할지 모르겠습니다.예를들어, 카메라 캡쳐해서 다음 스크린으로 캡쳐한 사진을 보내서 이미지를 보여주고 싶을 때, 어떻게 해야 하나요?
-
미해결실습으로 배우는 그라파나 - {{ x86-64, arm64 }}
Tabby 실행이 안됩니다.
환경은 윈도우입니다.ch2/2.3으로 작업하였고207은 설치가 안되어 1.0.208로 설치하였습니다.config.yaml파일을 %APPDATA% 경로에 "tabby" 라는 파일명으로 복사하는 작업이 맞는건가요?
-
해결됨[ 부트스트랩 5 ] 빠르고 스마트하게 웹 사이트 만들기 | Bootsrap 입문용
css 적용불가
html<!doctype html> <html lang="ko"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Gabie's ART Cook</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> <link rel="stylesheet" href="style.css"> </head> <body> <!-- 헤더 영역 시작 --> <header> <h1>Gabie's ART Cook</h1> <h4> 요리와 아트의 만남 </h4> <p> 아름다운 한 끼로 삶의 색채를 더하다</p> <button type="button" class="btn btn-outline-warning rounded-pilll"> 요리 보기 </button> </header> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script> </body> </html>cssheader{ background-color: blue; }이미지 파일 적용이 불가하여 background color로 테스트 해보았는데 css 적용이 불가합니다.
-
미해결
Beginner's Guide: +1 909-340-9227 How to Activate Your Cash App Card?
Activating your Cash App card is a straightforward process that allows you to start using your card for purchases, ATM withdrawals, and more. Whether you're new to Cash App or just need a refresher, this guide will walk you through the steps to activate your card quickly and easily.Step 1: Receive Your Cash App CardBefore you can activate your Cash App card, you need to have the card in your possession. If you haven't already ordered one, follow these steps:Open Cash App: Launch the Cash App on your mobile device.Go to the Card Tab: Tap the card icon at the bottom of the screen.Order Your Card: Follow the prompts to order your Cash App card. It will typically take 7-10 business days for your card to arrive.Step 2: Open Cash App and Navigate to the Card Activation SectionOnce you have your Cash App card, you can begin the activation process:Open Cash App: Launch the app on your mobile device.Go to the Card Tab: Tap the card icon at the bottom of the screen.Activate Your Card: Tap "Activate Cash Card" to start the activation process.Step 3: Use the QR CodeThe easiest way to activate your Cash App card is by using the QR code that comes with your card. Follow these steps:Scan the QR Code: When prompted, allow Cash App to access your camera and scan the QR code found on the paperwork included with your card.Follow the Prompts: Complete any additional steps as prompted by the app.Step 4: Manual EntryIf you don't have the QR code or if it doesn't scan properly, you can manually enter the information:Select "Use CVV Instead": If you can't scan the QR code, tap on "Use CVV Instead."Enter Card Details: Input your Cash App card details, including the CVV number and expiration date, as prompted by the app.Step 5: ConfirmationOnce you've scanned the QR code or manually entered your card details, you'll receive a confirmation message that your card has been activated. You can now start using your Cash App card immediately.Troubleshooting TipsEnsure Proper Lighting: When scanning the QR code, make sure you're in a well-lit area.Check Your Connection: A stable internet connection is crucial for the activation process.Update the App: Ensure you have the latest version of Cash App installed on your device.Using Your Cash App CardNow that your Cash App card is activated, you can:Make Purchases: Use your card anywhere Visa is accepted.Withdraw Cash: Access your funds at any ATM that accepts Visa.Manage Your Card: Use the Cash App to manage settings, check your balance, and view transactions.ConclusionActivating your Cash App card is a simple process that can be completed in just a few minutes. By following the steps outlined in this guide, you'll be ready to start using your Cash App card for all your financial needs. Enjoy the convenience and flexibility that comes with your Cash App card!
-
미해결실전 프로젝트로 배우는 타입스크립트
[오류문의] import 에러
안녕하세요.실전프로젝트로 베우는 타입스크립트 강의를 듣고 있습니다.코로나 정보 보여주는 프로젝트에서 질문드립니다.app.js 를 app.ts로 변환하고, 컴파일하면 아래와 같은 에러가 발생합니다.그래서 구글하여서,index.html 파일에 'type: "module" 을 추가했습니다. <<script type="module" src="./built/app.js"></script>그리고 package.json 에도 "type": "module" 을 추가했습니다. "type": "module""type": "module"이렇게 하고 다시 index.html를 live 서버 오픈을 하면 동일한 에러가 나옵니다.axios 와 char.js 모듈 import를 못하는 것 같습니다.구글링하여 이런저런 시도를 많이 해봤는데 해결이 되지 않습니다.그 외의 package.json, tsconfig.json는 강의영상에서 나온 그대로 타이핑 했습니다.어떻게 해야 import 가 정상적으로 될까요?
-
해결됨[임베디드 입문용] 임베디드 개발은 실제로 이렇게 해요.
Bord LED 점등이 안돼요
위 사진처럼 연결하였는데 Board에 LED가 안들어 옵니다.
-
미해결3. 웹개발 코스 [스프링 프레임워크+전자정부 표준프레임워크]
전자정부프레임워크를 다운받지않고 STS 에서 위 강의를 진행하고싶은데 방법이있을까요?
전자정부프레임워크를 다운받지않고 STS 에서 위 강의를 진행하고싶은데 방법이있을까요?
-
해결됨입문자를 위한 Spring Boot with Kotlin - 나만의 포트폴리오 사이트 만들기
프로그램 수정해서 다시 docker에 이미지를 올릴땐 내용처럼 이렇게 하면되나요??
안녕하세요. 이젠 기본적인 spring 기능은 이 강의로 많이 알게 되었습니다.감사합니다. 빨리 강좌 하나 더 내주세요.... 코틀린 & spring 강좌가 너무 없어서 강의 찾아 다니느것도 일이네요 ...====================================Docker로 프로젝트 빌드 하기 . 강좌중에 만약 프로그램 수정하면 아래 처럼 하면 되나요?step 1) Gradle에서 jar 파일을 다시 만든다. ...참고 ) 빌드중에 에러가 없어야함... test 코드에서도 에러가 없어야함step2) docker-compose.yml 파일 새로고침 한다.step3) Dockerfile을 재 실행한다.step4) 도커가 잘 올라갔는지 확인한다.프로그램 수정후엔 위 4개의 절차대로 진행하면 되나요??이걸로 회사의 개인 서버를 가지고 있는곳에 도커 깔고 동작 하면 서버의 기능으로 완벽할꺼 같은데 ....그리고 구글 클라우드에도 프로그램 수정하면 도커에서 push up hub 를 누르고 docker-compose.yml 누르면 되나요??버전 수정 안해줘도 되나요?추가 질문) 이건 뭐 제가 잘 모르고 좀 시간을 두고 확인해봐야 하는거라서 질문드리기 어렵지만 그래도 아시면 답변 부탁 드려용 ^^)))테스트 코드 작성중 아래처럼 DSL로 작성하는 경우를 봤는데 꽤나 직관적이고 편리하게 되어 있더라구요...아래 같은 테스트 코드 많이 사용하나요??비동기 방식에서만 사용하나요??테스트 코드 작성하는 방법이 꽤나 많아서 이걸 다 익혀야하는 생기네요 ㅠ.ㅠ감사합니다. 다음 강의 꼭 내주세요. ^^
-
해결됨Real MySQL 시즌 1 - Part 1
페이징 쿼리 관련해서 질문드립니다.
현재 spring data jpa query + paging 을 사용하고 있습니다. fun findAllFollowing(followerId: Long, pageable: Pageable): List<SnapProfile> = from(snapProfileFollow) .join(snapProfile).on(snapProfile.id.eq(snapProfileFollow.following.id)) .where(snapProfileFollow.follower.id.eq(followerId)) .orderBy(*snapProfile.orderSpecifiers()) .offset(pageable.offset) .limit(pageable.pageSize.toLong()) .fetch() .map { it.following.toModel() }이것을 데이터 개수 기반으로 변경하고 싶은데 혹시 이럴 때 변경해보신 경험이 있으실까요?
-
해결됨실전! 코틀린과 스프링 부트로 도서관리 애플리케이션 개발하기 (Java 프로젝트 리팩토링)
테스트 코드와 관련하여 질문이 있습니다.
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.안녕하세요 강사님!테스트 코드와 관련하여 질문이 있습니다. 프로젝트를 해보면서 고민이 되었던 것 중 하나가 테스트 코드를 작성할 때 명확한 메서드명을 작성해야하는가에 대해서 고민이었습니다.@Dipslay로 어떤 테스트인지 명시를 하고 있음에도 메서드명이 명확한 것이 좋을까요?
-
미해결프로그래밍 시작하기 : 도전! 45가지 파이썬 기초 문법 실습 (Inflearn Original)
as 는 as 일뿐
with open("../source/32-2.json", "w") as out:여기서 as 를 alias 라는 의미로 말씀하셨는데 너무 어색한것 같아요. 파이썬 구문이 자연어에 가깝다는 장점이 바로 이 문장에서도 잘 나타나는데요 with 수단, 가지다 as 는 ~로, 동시성... 의미로 맥락을 연결해 볼게요. "../source/32-2.json" 파일을 쓰기 모드로 열고 사용을 할텐데, 이 파일을 out이라는 객체로 해서" 이렇게 해석하면 with open 문이 쉽게 습득되지 않을까요?
-
미해결Vue.js 완벽 가이드 - 실습과 리팩토링으로 배우는 실전 개념
컴포넌트 링크는 vue peek 익스텐션 설치가 필수인가요??
vue peek 설치 없이는 컴포넌트 위에 컨트롤 마우스로 올려놔도 링크 생성이 안되네요..
-
미해결빅데이터/텍스트마이닝 분석법 (LDA,BERTtopic,감성분석,CONCOR with ChatGPT)
LDAvis 시각화가 되지 않습니다.
안녕하세요 선생님, 수업 잘 듣고 있습니다. 파이썬 기본 용어 하나도 모르는데 선생님꺼 강의 보면서 하나씩 따라가고 있습니다. 다름이 아니라 저도 LDAvis 시각화가 되지 않는데요, 오류 코드는 다음과 같습니다. +AI 답변 참고해서 업그레이드 했는데도 여전히 오류라고 뜹니다.ict'방법 알려주시면 감사하겠습니다! /usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above. and should_run_async(code) Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (2.2.2) Requirement already satisfied: numpy>=1.22.4 in /usr/local/lib/python3.10/dist-packages (from pandas) (1.26.4) Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from pandas) (2.8.2) Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas) (2023.4) Requirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.10/dist-packages (from pandas) (2024.1) Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.2->pandas) (1.16.0) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/IPython/core/formatters.py in __call__(self, obj) 339 pass 340 else: --> 341 return printer(obj) 342 # Finally look for special method names 343 method = get_real_method(obj, self.print_method) 4 frames/usr/local/lib/python3.10/dist-packages/pandas/core/frame.py in to_dict(self, orient, into, index) 1986 >>> df['C'] = pd.date_range('2000', periods=2) 1987 >>> df.to_numpy() -> 1988 array([[1, 3.0, Timestamp('2000-01-01 00:00:00')], 1989 [2, 4.5, Timestamp('2000-01-02 00:00:00')]], dtype=object) 1990 """ TypeError: to_dict() takes from 1 to 2 positional arguments but 4 were given
-
미해결면접과 취업을 부르는 '퍼블리셔 개인 포트폴리오 홈페이지' 제작
포트폴리오 결과물 링크 문제
안녕하세요 선생님지금 포트폴리오 제작 결과물 링크 단계에 있어 문제가 생겨 글 남깁니다.모바일 웹 앱 서브 index 페이지 안에 multi-view 페이지를 링크하려고 하는데 버튼을 눌렀을 때화면이 이렇게 뜹니다.링크를 할 때 어떻게 파일 경로를 잡아야 할까요? 너무 복잡하여 물어봅니다 ㅠㅠ
-
해결됨(2025) 일주일만에 합격하는 정보처리기사 실기
쉬프트연산
이해가 어려운 섹션이나 영상 설명은 질문으로 꼭 남겨주세요.기출문제를 풀다가 막힌 개념이 있나요? 질문으로 회차나 번호, 개념을 예시로 질문해주세요. 답변에 도움이 됩니다.이론 문제는 통합본 PDF 파일로 제공될 예정입니다. (6월 중 업로드 예정)합격을 가르는 것은 역시 코드해석문제. 이론을 외울 시간이 없다면 코드에 익숙해지고, 중요 개념을 몇 가지 외워가면 합격할 수 있습니다.쉬프트연산 >>>2 일 때 1100이면 0011이 된다하셨는데 >>>3이라 세번을 밀게 될 때 1도 0으로 되나요? EX) >>>3 1100 -> 0001 이렇게?
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
@Injectable 관련 질문
안녕하세요의존성 주입을 하기 위해 @Injectable 하는걸로 이해했습니다.BearerTokenGuard 을 만들때 @Injectable 을 선언 하지 않는 이유는 BearerTokenGuard은 직접 사용하지 않고 RefreshTokenGuard, AccessTokenGuard 에서 상속을 받아 상속을 받는곳에서 @Injectable 을 하고 super로 실행시키는 거여서 그런건가요??
-
미해결Vue 3 시작하기
volar(vue language features) 검색 안됨
volar 와 vue language features 로 검색해봤지만, 영상에 나오는 플러그인은 검색이 안됩니다. 다른걸 설치해야할까요?
-
미해결
프로젝트 폴더가 안보입니다.
자바중급2편 수업자료 폴더 다운로드 후 압축해제 하고, 제 인텔리제이 프로젝트들이 담겨있는 폴더로 옮긴 뒤에 인텔리제이를 켜고 open으로 해당 폴더 선택해서 열었는데 위 사진과 같이 프로젝트 파일 디렉토리가 안보여요 ㅜㅜ파일은 이렇게 잘 들어가 있습니다.혹시몰라 java-mid2 파일내부까지 함께 캡쳐해서 올립니다!. 참고로 open jdk 깔려있고, 이 강의에서 사용하는 jdk도 다운받은 상태입니다
-
미해결[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
FutureBuilder에서 setstate사용
FutureBuilder를 사용하는 목적이 비동기 함수의 변경 사항을 감지하고 자동으로 ui를 업데이트 해주는 기능으로 알고 있습니다.그래서 stateless위젯에서도 사용가능한걸로 알고 있습니다.이번 프로젝트에서는 FutureBuilder를 사용해도 setState가 필요한지 헷갈립니다.혹시 제가 잘못 알고 있는 건지 아니면 future로 받는 테이블 데이터가 변경 사항이 없어서 그런 건지 궁금합니다!