묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
섹션4 01-02-emotion 에러가 나는데 못찾겠습니다ㅜ
설치가 잘못된 걸까요.. yarn dev하니 오류가 납니다ㅜ
-
해결됨
파이참 sorted 함수 오류 살려주세요
안녕하세요 파이참으로 코드를 실행시키는데 Traceback (most recent call last): File "C:\Program Files\JetBrains\PyCharm Community Edition 2023.3.4\plugins\python-ce\helpers\pydev\pydevconsole.py", line 364, in runcode coro = func() ^^^^^^ File "<input>", line 1, in <module> File "C:\Users\user\PycharmProjects\bigdata2024\.venv\Lib\site-packages\pandas\core\generic.py", line 6299, in getattr return object.__getattribute__(self, name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AttributeError: 'DataFrame' object has no attribute 'quality' 이런 오류가 뜹니다 코드 그대로 친 것 같은데 이유를 모르겠습니다ㅜㅜ import pandas as pd red_df = pd.read_csv('C:/Users/user/PycharmProjects/bigdata2024/.venv/winequality-red.csv', sep=';', header=0, engine='python') white_df = pd.read_csv('C:/Users/user/PycharmProjects/bigdata2024/.venv/winequality-white.csv', sep=';', header=0, engine='python') red_df.to_csv('C:/Users/user/PycharmProjects/bigdata2024/.venv/winequality-red2.csv', index=False) white_df.to_csv('C:/Users/user/PycharmProjects/bigdata2024/.venv/winequality-white2.csv', index=False) red_df.head() red_df.insert(0, column='type', value = 'red') red_df.head() red_df.shape white_df.head() white_df.insert(0, column='type', value='white') white_df.head() white_df.shape wine = pd.concat([red_df, white_df]) wine.shape wine.to_csv('C:/Users/user/PycharmProjects/bigdata2024/.venv/wine.csv', index=False) print(wine.info()) wine.columns = wine.columns.str.replace(' ','_') wine.head() wine.describe() sorted(wine.quality.unique())살려주세요
-
미해결[코드팩토리] [입문] Dart 언어 4시간만에 완전정복
쿠폰발급이 안되네요 ;;
별 5개 평점 남기고9363-87b86b17809c이 코드로 할인 받으려는데 되지않네요;;디스코드도 안됩니다
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
7회 기출 유형(작업형3) 문제 1-1
문제에서 수컷일 오즈비 확률을 구했는데, 혹시 암컷일 오즈비 확률은 어떻게 구할 수 있을까요??
-
해결됨[웹 개발 풀스택 코스] 순수 자바스크립트 기초에서 실무까지
Array 객체 내장 함수 sort함수()
sort()함수 부분에 대해서 헷갈리는 부분이 있어서 질문드려요! 질문1. 인자 a, 인자b의 순서가 다름제가 알고 있기로는 인자 a - 100, b - 40 으로 알고 있습니다강사님이 설명하신것은 인자 a - 40, 인자 b - 100입니다.console.log 출력 결과는 a - 100, b - 40 으로강사님 설명과 반대로 나와서 제가 출력시 실수한 부분이 있는지 질문드립니다 질문2. 양수일때 자리가 바뀐다질문1. 에서 인자 a - 100, b - 40 이 맞다면음수일때 자리가 바뀌는게 맞지 않나요?? 바쁘시겠지만 답변부탁드립니다!
-
미해결2시간으로 끝내는 코루틴
자식1, 2와 부모코루틴의 관계
본 강의를 모두 수강하였습니다! 코루틴에서 헷갈렸던 개념들을 알 수 있어서 좋았습니다!본 코루틴 강의에서 자식과 부모 관계의 에러가 발생했을 때 에러 핸들링 하는 경우는 자식이 하나만 존재했을 때의 예시밖에 없어서 직접 2개를 가지고 실험을 해보았습니다! 먼저, 자식1이 취소가 됐을 때에는 취소예외가 발생했기 때문에 부모로 전파되지 않고, 그러므로 다른 자식2도 영향을 받지 않는다 라고 이해를 하고 있습니다!하지만 자식1에서 취소가 아닌 예외가 발생했을 경우 부모로 전파되는 것으로 알고있고, 이 때 적절한 조치가 되지 않는다면 자식2까지 취소되는 것으로 알고있습니다!따라서 다음과 같이 CoroutineExceptionHandler를 적용해보았습니다.fun main() = runBlocking { val handler = CoroutineExceptionHandler { _, exception -> println("Caught exception: $exception") } val parentJob = CoroutineScope(Dispatchers.Default).launch(handler) { val job1 = launch { println("Job 1 is running") throw RuntimeException("Error in Job 1") } val job2 = launch { println("Job 2 is running") delay(1000) println("Job 2 is completed") } job1.join() job2.join() } parentJob.join() println("Parent job is completed") }Job 1 is runningCaught exception: java.lang.RuntimeException: Error in Job 1Parent job is completed결과는 자식1만 실행이되고, 거기서 Exception을 던졌는데, Job2는 취소되는것으로 보입니다..!질문 1 ) 다음과 같이 try catch 로 전환하면 자식2의 취소가 발생하지 않는데, CoroutineExceptionHandler로는 자식2의 취소를 막을수는 없는 것일까요?val job1 = launch { println("Job 1 is running") try { throw RuntimeException("Error in Job 1") } catch (e: RuntimeException) { println("RuntimeException") } }질문 2) 강의내용에서는 SupervisorJob() 을 사용하면 부모 코루틴으로 예외가 전파되지 않는다고 해주셨는데, 다음 결과에서는 부모코루틴에 해당되는 CoroutineExceptionHandler 가 실행되는 것으로 보입니다. 하지만, 질문1에서 걱정하는 자식2의 취소로 이어지지 않고 있습니다. 이는 부모코루틴으로 예외가 전파되는 상황일까요?? 만일 전파되는 상황이라면 왜 질문1과는 다르게 자식2의 취소로 이어지지 않는 것일까요?fun main() = runBlocking { val handler = CoroutineExceptionHandler { _, exception -> println("Caught exception: $exception") } val parentJob = CoroutineScope(Dispatchers.Default).launch(handler) { val job1 = launch(SupervisorJob()) { println("Job 1 is running") throw RuntimeException("Error in Job 1") } val job2 = launch { println("Job 2 is running") delay(1000) println("Job 2 is completed") } job1.join() job2.join() } parentJob.join() println("Parent job is completed") }Job 1 is runningJob 2 is runningCaught exception: java.lang.RuntimeException: Error in Job 1Job 2 is completedParent job is completed자바 -> 코틀린 강의부터 시작해서 코루틴 강의까지 너무 감사하게 잘 보고있습니다! 감사드립니다 🙂
-
미해결설계독학맛비's 실전 Verilog HDL Season 1 (Clock부터 Internal Memory까지)
실습자료 불일치 건
커리큘럼에 있는 실습 자료를 다운받아서 목차를 보았더니 실습 자료와 일치를 하지 않습니다. 어떻게 해야 할까요?
-
미해결실습으로 끝장내는 웹 크롤링과 웹 페이지 자동화 & 실전 활용
제품 링크를 타고 들어가야 원하는 정보가 나오는 사이트
from selenium import webdriver from selenium.webdriver.chrome.options import Options # from selenium.webdriver.chrome.service import Service # from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys import requests from bs4 import BeautifulSoup import time options = Options() user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" options.add_argument(f"user-agent={user_agent}") options.add_experimental_option("detach", True) driver = webdriver.Chrome(options=options) url = "https://kream.co.kr/search?shop_category_id=34" driver.get(url) time.sleep(2) for i in range(1): driver.execute_script("window.scrollTo(0, document.body.scrollHeight)") time.sleep(2) html = driver.page_source soup = BeautifulSoup(html, "html.parser") items = soup.select(".product_card") for item in items: brand = item.select_one(".product_info_brand.brand") name = item.select_one(".translated_name") link = item.select_one(".item_inner").attrs['href'] click = name.text driver.find_element(By.PARTIAL_LINK_TEXT, click).send_keys(Keys.CONTROL+Keys.ENTER) time.sleep(1) driver.switch_to.window(driver.window_handles[-1]) html = driver.page_source soup2 = BeautifulSoup(html, "html.parser") model_num = soup2.select_one("div:nth-child(3) > div.product_info") print(brand.text.strip()) print(name.text) print(model_num.text.strip()) print(f"https://kream.co.kr{link}") print() driver.close() driver.switch_to.window(driver.window_handles[0]) 아무것도 모르는 상태에서 시작했는데 좋은 강의 올려주신 덕분에 크롤링을 조금이나마 맛보게 된 것 같습니다. 어설프게나마 완성은 한거 같은데 궁금한게 있어서 질문 남깁니다.상품 링크를 타고 들어가야 원하는 정보를 긁어올 수 있는 사이트인데, 자바스크립트로 동작하게끔 되어 있습니다.시행착오 끝에 셀레니움으로 동작을 시켜봤는데제품 하나하나마다 새창을 열어서 정보를 가져온 후에 창을 닫고.. 다시 새창을 열어서 정보를 가져온 후에 창을 닫고..하다보니 시간도 너무 오래 걸리고 이렇게 하는게 맞는 건지 의구심이 듭니다.어떻게 해야 속도를 높힐 수 있을까요?
-
해결됨[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part1: C++ 프로그래밍 입문
Strcat함수 질문입니다
제가 군대 사지방이라 강의가 잘 안나와서 그런데 일단 혼자 만들어보면서 출력물은 똑같이 만들어지긴 했습니다만이렇게 코드를 짜보았는데 혹시 결과만 똑같으면 어떤 코드든지딱히 상관은 없는건지 궁금합니다 ex)최적화나 가독성등등
-
미해결개발자를 위한 쉬운 도커
데이터베이스 질문입니다!
안녕하세요 데브위키님강의 수강 중 궁금한 점이 있어 질문 드립니다. 제가 지식이 얕아 틀릴 확률이 매우 큰데 저의 생각이 맞았는지 틀렸다면 지적도 부탁드립니다! 클라우트 네이티브 애플리케이션에서의 MSA는 수평 확장이 용이하다고 PART5에서 이해했습니다. 만약 DB 서버를 늘려야 한다고 했을 때현재 강의에서처럼 Postgre를 도커 볼륨을 사용하여 이중화 DB를 사용한다면 AWS에서 새로운 인스턴스를 만들어서 도커를 설치하고 컨테이너를 만들게 되면 기존 서버의 도커 볼륨에 있는 데이터를 알 수 없어 서버를 늘리기가 힘들다고 생각합니다.당연히 방법이 있을 것 같은데확장을 하게 된다면 어떤 방식으로 확장을 하게 되는 건지 질문드립니다!
-
미해결파이썬/장고 웹서비스 개발 완벽 가이드 with 리액트 (장고 4.2 기준)
질문입니다
데스크탑으로만 하다가 노트북으로 다시 진행중에Hottrack쪽에 오류가 계속 생깁니다앱등록도 하고 앱 설치도 다 했는데 무엇이 문제일까요..?
-
해결됨[유니티 레벨 업!] 모듈식으로 개발하는 퀘스트&업적 시스템
스크립터블 오브젝트 Instantiate?
런타임에 스크립터블 오브젝트를 복사하는 것은 별로 좋지 않은 행위라고 들었습니다. 직렬화된 일반 클래스를 사용하는 것이 더 좋다고 여러 차례 들어왔는데, Task 클래스를 일반 클래스로 전환하는 것이 좋은 생각인지 궁금합니다.
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
main 함수 실행이 안되요
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.spring-io에서 만들어서 intellj에서 실행했는데 실행이 되지가 않습니다 뭐가 문제일까요 1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요.
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
fit할때 X_tr,Y_tr 이 아닌 train으로 할경우 문제
일단 실기가 명확한 풀이과정이 없기는 하기는 하나저는 X_tr, y_tr로 accuracy_score, precision_score, recall_score, f1_score, roc_auc_score 비교한 뒤에점수가 높은것을 바탕으로 다시 train을 fit시키는게 일반적으로 더 나은 전략이 아닌가싶은데(양이 더많으니까)혹시 이게 크게 리스크가 있다거나 혹은 의미가 없다고 볼수있을까요? 강의에서는 X_tr, y_tr로만 하고 끝내길래 궁금해서 여쭤봅니다.
-
해결됨10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
2-E 기저조건 질문있습니다
안녕하세요 선생님 🙂함수에 있는 기저조건과 4가지 숫자가 같을 경우에 리턴 값으로 string(1, a[y][x])를 주셨는데요, 1 또는 0이라고 말씀해주셨지만 이해가 가지 않습니다. string 키워드로 교안과 구글을 찾아봤고, xstring으로 타고 들어가 분석해보려고도 했지만 마땅한 답을 찾지 못하였습니다.string함수 관한 설명이나 참고할 수 있는 교안의 목차를 알려주신다면 정말 감사하겠습니다 🙂 추가로, 함수 안에 있는 string ret = "";를 전역으로 빼면 값이 이상해지더라구요. 이유를 잘 모르겠어서 질문드립니다.
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
10 issues were found when checking AAR metadata:
파이어베이스 북마크 만들기 하면서 나오는 에러입니다.1. Dependency 'androidx.credentials:credentials:1.2.0-rc01' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 2. Dependency 'androidx.credentials:credentials-play-services-auth:1.2.0-rc01' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 3. Dependency 'androidx.navigation:navigation-common:2.7.5' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 4. Dependency 'androidx.navigation:navigation-common-ktx:2.7.5' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 5. Dependency 'androidx.navigation:navigation-runtime:2.7.5' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 6. Dependency 'androidx.navigation:navigation-ui:2.7.5' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 7. Dependency 'androidx.navigation:navigation-runtime-ktx:2.7.5' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 8. Dependency 'androidx.navigation:navigation-ui-ktx:2.7.5' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 9. Dependency 'androidx.navigation:navigation-fragment-ktx:2.7.5' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 10. Dependency 'androidx.navigation:navigation-fragment:2.7.5' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.0.0 is 33. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 34, then update this project to use compileSdk of at least 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 대체 어떤 부분을 봐야 할까요...
-
해결됨[Python 초보] Flutter로 만드는 ChatGPT 음성번역앱
휴대폰에서 동영상이 재생이 안됩니다 ㅠㅠ
안녕하세요 좋은 강의 감사합니다 한가지 아쉬운점이 발견되었습니다 안드로이드 폰으로 접속시 계속 로딩창만 뜨면서 재생이 안됩니다.3015 또는 3016 에러코드도 계속 보여주네요데스크톱 PC회면에서는 잘되네요 감사합니다 좋은 즐거운 주말 하루되셔요
-
해결됨실전! Querydsl
상속 구조 내에서 Querydsl로 특정 타입의 엔티티에만 조인
안녕하세요, 질문이 있어서 글 남기게 되었습니다.이런식으로 지점(branch)명에 맞는 공간(space)중 미팅룸 리스트를 보여주고해당 미팅룸의 해당 날짜의 예약들도 보여주는 기능을 구현하고자 @Override public List<Reservation> findReservationListByDateAndBranchName(LocalDateTime startDatetime, LocalDateTime endDateTime, String branchName) { return queryFactory .select(reservation) .from(reservation) .join(reservation.space, space).fetchJoin() .join(space.branch, branch) .where(branch.branchName.eq(branchName), reservation.reservationStartDateTime.between(startDatetime, endDateTime), space.dtype.eq("MeetingRoom") ) .fetch(); }이런 코드를 작성하였는데 아래와 같은 연관관계 때문에Reservation Entity@Getter @Entity @NoArgsConstructor(access = AccessLevel.PROTECTED) @Table(name = "reservation") public class Reservation extends BaseEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "reservation_id") private Long reservationId; @Column(name = "reservation_start_date_time") private LocalDateTime reservationStartDateTime; @Column(name = "reservation_end_date_time") private LocalDateTime reservationEndDateTime; @OneToMany(mappedBy = "reservation") private List<MemberReservation> memberReservations = new ArrayList<>(); @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "space_id") private Space space; }Space Entity@Getter @Entity @NoArgsConstructor(access = AccessLevel.PROTECTED) @Inheritance(strategy = InheritanceType.JOINED) @Table(name = "space") @DiscriminatorColumn public abstract class Space { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "space_id") private Long spaceId; @NotNull @Column(name = "space_name") private String spaceName; @NotNull @Column(name = "space_floor") private int spaceFloor; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "branch_id") private Branch branch; @OneToMany(mappedBy = "space") private List<Reservation> reservations = new ArrayList<>(); @NotNull @Column(name = "dtype", insertable = false, updatable = false) private String dtype; }Space를 상속받는 FocusDesk, MeetingRoom, RechargingRoom@Getter @Entity @NoArgsConstructor(access = AccessLevel.PROTECTED) @Table(name = "focus_desk") public class FocusDesk extends Space { //추후에 해당 엔티티에 맞는 필드들 추가 } @Getter @Entity @NoArgsConstructor(access = AccessLevel.PROTECTED) @Table(name = "meeting_room") public class MeetingRoom extends Space { @Column(name = "meeting_room_capacity") @Positive private int meetingRoomCapacity; } @Getter @Entity @NoArgsConstructor(access = AccessLevel.PROTECTED) @Table(name = "recharging_room") public class RechargingRoom extends Space { //추후에 해당 엔티티에 맞는 필드들 추가 } select r1_0.reservation_id, r1_0.created_date, r1_0.last_modified_date, r1_0.reservation_end_date_time, r1_0.reservation_start_date_time, s1_0.space_id, s1_0.dtype, s1_0.branch_id, s1_0.space_floor, s1_0.space_name, s1_2.meeting_room_capacity from reservation r1_0 join (space s1_0 left join focus_desk s1_1 on s1_0.space_id=s1_1.space_id left join meeting_room s1_2 on s1_0.space_id=s1_2.space_id left join recharging_room s1_3 on s1_0.space_id=s1_3.space_id) on s1_0.space_id=r1_0.space_id join branch b1_0 on b1_0.branch_id=s1_0.branch_id where b1_0.branch_name=? and r1_0.reservation_start_date_time between ? and ? and s1_0.dtype=?이런 쿼리가 나가게 됩니다.처음에는 dtype 없이 MeetingRoom 만 join 하고 싶었지만reservation.meetingRoom 이불가능하여(reservation은 space랑 매핑 되어있으니까)불가능하여 이방법 밖에는 떠오르지 않았습니다. 문제는 위의 쿼리처럼 쓸모없는 테이블들을 강제로 조인한 후에 다시 where절의 dtype으로 구분을 해야한다는 것입니다. @Query("SELECT new com.example.sabujak.reservation.dto.ReservationQueryDto(r.reservationStartDateTime, r.reservationEndDateTime, s.spaceId, s.spaceFloor, s.spaceName, m.meetingRoomCapacity) " + "FROM Reservation r " + "JOIN r.space s " + "JOIN MeetingRoom m ON m.spaceId = s.spaceId " + "JOIN s.branch b " + "WHERE b.branchName = :branchName " + "AND r.reservationStartDateTime BETWEEN :startDateTime AND :endDateTime")이런식의 jpql로는 해결이 가능하지만추후에 정렬조건을 동적으로 받아야 하기에 querydsl을 사용해서 최대한 좋은 방향으로 사용하고 싶은데어떻게 해야할지 잘 모르겠습니다
-
해결됨김영한의 실전 자바 - 중급 1편
섹션6 날짜와 시간 - 문제와 풀이2 질문.
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]안녕하세요. 섹션6 날짜와 시간 문제풀이2번째에서 막혀서 질문을 드립니다.현재 저의 코드 상태가그림으로 보시는 봐와 같이 이런 상태이고,지금 이 상태 에서, 월요일이 첫 시작 일 때(2024년 1월 1일기준),월요일에서 날짜를 넣는 방법을 모르겠더라고요. 이럴 때 에는 문제와 풀이2 해석을 보는게 나은지? 아니면 검색을 해서 라도 푸는게 나은지 알고 싶습니다.답변 부탁 드립니다.참조한 클래스는 TestLoopPlus, TestAdjusters 이 두개를 참조 했습니다.(클래스 이름 +import는 pdf에서 봄)
-
미해결실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화
갑자기 개념이 혼동됩니다..ㅠ
@RestController JSON형식으로 응답본문에 나오는것도 알겠고 @RequesyBody은 요청본문은 자바객체로 매핑하는것도 알고있습니다.근데 @Controller로 진행하면서 모델에담고 return을 뷰로 전달하는 형식으로하다가 갑자기 REST API?형식으로 진행하게되서 뭔가 갑자기 햇갈려졌는데..이유를모르겠습니다