묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결자바 개발자를 위한 코틀린 입문(Java to Kotlin Starter Guide)
internal 이해가 안갑니다 ㅠ
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.같은 모듈에서만 접근 가능하고 여기서 말하는 모듈은 IDEA Module, Maven project 등등 이라고 하셨는데요이게 정확한 어디 범위인지 제가 지식이 낮아서 그런지 이해가 잘안됩니다ㅠ 다른 클래스에서는 접근이 가능 한건가요?
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
회원 서비스 테스트
코드 다 입력하고 실행했는데 MemberService memberService; ^ symbol: class MemberService location: class MemberServiceTest이런 오류가 납니다어떻게 해결해야 하나요?
-
해결됨(2025) 일주일만에 합격하는 정보처리기사 실기
업캐스팅 문제 질문드립니다.
이해가 어려운 섹션이나 영상 설명은 질문으로 꼭 남겨주세요.기출문제를 풀다가 막힌 개념이 있나요? 질문으로 회차나 번호, 개념을 예시로 질문해주세요. 답변에 도움이 됩니다.이론 문제는 통합본 PDF 파일로 제공될 예정입니다. (6월 중 업로드 예정)합격을 가르는 것은 역시 코드해석문제. 이론을 외울 시간이 없다면 코드에 익숙해지고, 중요 개념을 몇 가지 외워가면 합격할 수 있습니다.이 문제 바로 위에 문제에는 생성자 of A를 먼저 출력했는데, 이 문제는 왜 생성자 of AA10이 먼저 출력되었을까요?
-
미해결
CRISC Certification Training: Enhancing Expertise in IT Risk Management
The Certified in Risk and Information Systems Control (CRISC) certification, administered by ISACA, is one of the most prestigious credentials for professionals in the field of IT risk management. Achieving CRISC certification demonstrates a deep understanding of the complexities involved in identifying, assessing, and managing IT risks, as well as implementing and maintaining effective information systems controls. CRISC certification training equips professionals with the knowledge and skills needed to excel in these areas, thereby enhancing their career prospects and their ability to contribute to organizational success.Overview of CRISC CertificationThe CRISC certification focuses on four key domains:Governance: Establishing and maintaining governance frameworks to ensure that IT risk management aligns with business objectives.IT Risk Assessment: Identifying, analyzing, and evaluating IT risks to understand their potential impact on the organization.Risk Response and Reporting: Developing and implementing strategies to mitigate identified risks and communicating these risks effectively to stakeholders.Information Technology and Security: Ensuring that IT controls and security measures are in place to protect information assets.These domains encompass the full spectrum of IT risk management, from strategic planning to operational execution, making CRISC certification highly relevant for professionals in a variety of roles.Benefits of CRISC Certification TrainingCareer AdvancementEnhanced Job Prospects: CRISC certification is recognized globally, and employers value it as a mark of excellence in IT risk management. Certified professionals often find themselves better positioned for promotions and new job opportunities.Increased Earning Potential: Certified professionals typically command higher salaries due to their specialized knowledge and skills in managing IT risks.Skill DevelopmentComprehensive Knowledge: CRISC training covers a wide range of topics, providing a holistic understanding of IT risk management. This includes risk identification, assessment, response, and monitoring, as well as the development of effective governance frameworks.Practical Application: The training emphasizes real-world scenarios and practical applications, ensuring that professionals can apply what they have learned to their daily responsibilities.Organizational BenefitsImproved Risk Management: Organizations benefit from having CRISC-certified professionals on their teams, as these individuals are equipped to develop and implement robust risk management strategies. This leads to better protection of information assets and improved decision-making.Enhanced Compliance: Certified professionals help organizations meet regulatory and compliance requirements by ensuring that appropriate controls and governance frameworks are in place.Professional CredibilityIndustry Recognition: CRISC certification is highly respected in the industry, and holding this credential enhances an individual's professional credibility and reputation.Networking Opportunities: Certified professionals gain access to ISACA’s global community, providing valuable networking opportunities and resources for continuous learning and career development.CRISC Training CurriculumCRISC certification training is designed to provide a thorough understanding of each of the four domains. Here’s an overview of what participants can expect to learn:GovernanceRisk Governance Framework: Understanding the components of an effective risk governance framework and how to align it with business objectives.Policy Development: Developing and implementing policies and procedures for IT risk management.Stakeholder Communication: Engaging with stakeholders to ensure they understand the importance of IT risk management and their role in the process.IT Risk AssessmentRisk Identification: Identifying potential IT risks through various methods, including interviews, surveys, and threat analysis.Risk Analysis: Analyzing the likelihood and impact of identified risks using qualitative and quantitative methods.Risk Evaluation: Evaluating risks to determine their significance and prioritize them for treatment.Risk Response and ReportingRisk Mitigation Strategies: Developing and implementing strategies to mitigate identified risks, including risk avoidance, reduction, sharing, and acceptance.Incident Response: Preparing for and responding to IT incidents in a way that minimizes impact and facilitates recovery.Risk Reporting: Creating reports that communicate risk management activities and outcomes to stakeholders.Information Technology and SecurityControl Design and Implementation: Designing and implementing controls to protect information assets and ensure the reliability of information systems.Security Management: Managing information security programs to protect against threats and vulnerabilities.Compliance and Auditing: Ensuring that IT controls comply with regulatory requirements and conducting audits to verify their effectiveness.Preparing for the CRISC ExamThe CRISC exam is rigorous and requires thorough preparation. Here are some tips for success:Study Materials: Utilize ISACA’s official study materials, including the CRISC Review Manual, practice exams, and online resources. These materials are designed to cover all aspects of the exam content.Training Courses: Enroll in formal training courses offered by ISACA or accredited training providers. These courses provide structured learning and access to experienced instructors.Study Groups: Join study groups or online forums to collaborate with other candidates. Sharing knowledge and discussing complex topics can enhance understanding and retention.Practice Exams: Take practice exams to familiarize yourself with the format and types of questions that will be on the actual exam. This also helps identify areas where additional study is needed.Time Management: Develop a study schedule that allows ample time for each domain. Consistent, focused study sessions are more effective than last-minute cramming.ConclusionCRISC certification training is a valuable investment for IT professionals seeking to advance their careers in risk management. It provides comprehensive knowledge, practical skills, and a globally recognized credential that enhances job prospects and earning potential. For organizations, having CRISC-certified professionals means improved risk management practices, better compliance, and enhanced protection of information assets. Through a combination of structured learning, practical application, and rigorous exam preparation, CRISC certification training prepares professionals to excel in the dynamic field of IT risk management.
-
해결됨AWS(Amazon Web Service) 입문자를 위한 강의
5-5 s3 실습 - ACL edit 버튼이 비활성화일 때 해결 방법
Q. 왜 ACL의 edit이 비활성화되어있나?Bucket owner enforced 설정 때문.맨 처음 bucket 생성시, Object Ownership에서 ACLs disabled(recommeded)를 선택해서 그렇습니다.그렇다고 ACL을 활성화하면 일부 기능이 제한될 수 있다고 하네요.>>> 결론: Bucket policy를 추가해서 해결했습니다.1. bucket의 permission 탭에서 Bucket policy Edit 클릭.다음 스크립트를 넣으시고 save changes 클릭 후 아까 access denied 뜨던 object url 새고하면 이미지가 잘 보입니다.{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*" } ] }- 스크립트 내 version은 AWS의 IAM 정책 문서 버전이라고 하네요.
-
미해결
인텔리제이 패키지 상위폴더명이 갑자기 찍혀요
사진처럼 하위 패키지 생성 중에 상위폴더명이 자꾸 찍혀서 나와요 갑자기 ㅠㅠ 왜그럴까요? 구조 View 건드는 거 다 해도 안되네요...
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
fetchUseditems 나 fetchUseditem에 제목이 어떤걸로 사용하나요?
판매자: name2019 LTE 32GB: remarks240.120원: price내용: contents태그: tags찜: pickedCount주소: useditemAddress를 사용을 하는데 "삼성전자 갤럭시탭 A 10.1" 이건 어디서 가져왔는지 모르겠습니다.title은 playground를 봐도 안 나와 있는데 어떤 걸 사용을 해야 하나요?
-
미해결[입문자를 위한 UE5] Part3. 언리얼 엔진 3D 게임 개발 입문
IsTargetInRange(데코레이터) 내용 오류 아닌가요?
Q. 마지막에 삽입한 IsTargetInRange(데코레이터) 에서 Target에 SelfActor를 참조하도록 되어있는데 TargetEnemy를 참조해야 하는 것 아닌가해서요데코레이터 로직 안에서 Target의 오브젝트 이름을 출력해보니 Player가 아니라 Monster가 찍히더라구요(SelfActor에 값을 할당해준 적도 없는데 왜 들어간 건지는 모르겠지만...)
-
미해결쿠버네티스 어나더 클래스-Sprint 1, 2 (#실무기초 #설치 #배포 #Jenkins #Helm #ArgoCD)
bitnami keyloak helm 설치
안녕하세요 bitnami의 keycloak차트로 eks에서 keycloak 설치하려는데 postgresql이 계속 정상적으로 뜨지않습니다. 디버깅해보았을땐 hugepage를 끄라는데 찾은대로 꺼도 제대로 안뜨네요. 딱히 에러로그도없습니다. storageclass 등등도 정상으로 볼륨도 잘 붙고요. bitnami keycloak 설치 되신다면 values file공유 가능할까요?
-
미해결AWS(Amazon Web Service) 입문자를 위한 강의
강사님 connect.php 부분이 생각보다 잘 안풀리네요ㅠㅠ
다른분들도 지금 똑같은 문제를 겪고 계시지만 php 내용이 화면에 보여주는 거 까지는 나오는데 그 이후에 이제 nano connect.php 부분부터 아예 막혀버렸네요. 질문 커뮤니티의 다른 분들 스크립트를 사용해도 계속 HTTP ERROR 500만 나오고 확인해보니 (mysql --version) mysql maria db 조차도 다운이 안되어있는거같아서 다운을 하려해도 "command not found" 만 뜨고 버전이 달라져서 그런가요?
-
미해결Practical Testing: 실용적인 테스트 가이드
통합 테스트 시 변수 지정은 어떻게 해주는게 좋을까요?
학습 관련 질문을 남겨주세요. 어떤 부분이 고민인지, 무엇이 문제인지 상세히 작성하면 더 좋아요!먼저 유사한 질문이 있었는지 검색해 보세요.서로 예의를 지키며 존중하는 문화를 만들어가요. DB_URL과 같이 변수로 지정하여 통합 테스트를 수행할 경우 따로 설정해주어야하는데요. 저는 보통 인텔리제이에서 environment variables에 추가하여 실행해줍니다. 그런데 CI에서 빌드를 해줄 경우에도 변수를 지정해주어야하는데요. 테스트에도 지정하고 빌드할 때에도 지정해주는 것이 비효율적인것 같습니다. 이럴 경우 어떻게 설정해주는게 좋을까요?
-
미해결취미로 해킹#1(OverTheWire - Bandit)
Bandit 16 RSA키가 안나와요
31790 포트 연결해서 현재 단계 패스워드를 입력하면 Correct가 나오면서 RSA 키를 얻어야 하는데 몇 번을 해도 KEYUPDATE만 나오네요. 어떻게 해결해야 하나요?
-
미해결김영한의 실전 자바 - 중급 2편
if 문 작성 시 else 도 함께 작성해주는 것이 좋나요?
문제 1번의 경우 if 구문을 사용할 때 저는 else 를 안 넣고 바로 return 으로 표현했거든요.static <T extends BioUnit> T maxHp(T unit1, T unit2) { if (unit1.getHp() > unit2.getHp()) { return unit1; } return unit2; }답안엔 else 를 같이 쓰는 것으로 나와서 혹시 else를 쓰고 안 쓰고를 결정하는 메뉴얼이나 혹은 더 좋은 코드의 기준이 있을까요?=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요.
-
미해결처음하는 파이썬 백엔드 FastAPI 입문 (FastAPI부터 비동기 SQLAlchemy까지) [풀스택 Part1-2]
uvicorn main:app --reload 실행 불가
강의 준비를 위한 FastAPI 개발환경 설정 uvicorn main:app --reload이 명령어를 입력하면 아래의 에러가 나는데요. python -m uvicorn main:app --reload이 명령어로 서버 실행을 하고 있는데 상관 없을지요. PATH 변수 수정을 했지만 계속 아래의 에러가 나네요. uvicorn : 'uvicorn' 용어가 cmdlet, 함수, 스크립트 파일 또는 실행할 수 있는 프로그램 이름으로 인식되지 않습니다. 이름이 정확한지 확인하고 경로가 포함된 경우 경로가 올바른지 검증한 다음 다시 시도하십시오.위치 줄:1 문자:1+ uvicorn main:app --reload+ ~~~~~~~ + CategoryInfo : ObjectNotFound: (uvicorn:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
-
미해결자바 ORM 표준 JPA 프로그래밍 - 기본편
연관관계 주인이 아닌 엔티티의 참조변수에는 왜 JPA 어노테이션이 붙어지는 건가요?
제가 이해가 안가는 것이 있어 질문드려요 기존 Team 과 Member 예시로 질문할게요Member가 연관관계의 주인이고Team 은 객체 상 그저 Member에 대한 참조만 갖는 List<Member> members 만 있는 예시로 질문하겠습니다public void 연관관계_설정() { //회원1 저장 Member member1 = new Member("member1", "회원1"); em.persist(member1); //회원2 저장 Member member2 = new Member("member2", "회원2"); em.persist(member2); Team team1 = new Team("team1", "팀1"); //연관관계 설정 member1.setTeam(team1); team.getMembers().add(member1); member2.setTeam(team1); team.getMembers().add(member2); em.persist(team1); }여기서 team.getMembers().add(member1); 은 사실 상 DB를 바꾸지 않는 것인데예시 상 Member와 Team은 객체 단에서 서로 양방향 참조를 해야하기 때문에List를 넣어주거잖아요? 그럼 Team 입장에서 List<Members> members는JPA, 즉 DB 작업과 전혀 상관이 없는 그저 어플리케이션 입장에서 양방향 참조를 해야할 상황(기능)이 있어서추가된 것인데 왜 어노테이션을 써줘야하는거죠? 어노테이션을 붙이는 이유가 JPA가 해석할 것이 있어서 붙이는거잖아요? 근데 Team의 List<Members> members는 JPA가 해석해봤자 DB를 변경하는 일도 아니고그저 어플리케이션 계층에서 사용되는 변수인데 왜 JPA 어노테이션(@OneToMany)를 붙이는거죠?? ai 봇 말고 튜터님께서 답변해주시면 감사하겠습니다!!
-
미해결Readable Code: 읽기 좋은 코드를 작성하는 사고법
강의를 다 들은 후에 오랜 궁금증에 대해 질문드립니다!
안녕하세요, 우빈님! 정말 좋은 강의를 제공해주셔서 감사합니다. 제가 고민하던 주제에 관해 다뤄주셔서 정말 흥미를 가지고 강의를 들을 수 있었습니다☺강의를 다 들은 시점에 개발 공부를 시작한 이래로 늘 가지고 있던 오랜 궁금한 점이 있어서 이렇게 질문을 남기게 되었습니다! 조금 장문이 될 수도 있을 거 같네요🥲스프링을 사용해서 개발하게 되면 제일 처음 배우는 구조가 Controller -> Service -> Repository 이런 구조인데요, 보통 비즈니스 로직은 Service 에 작성된다고 배웠습니다. Service 레이어에서 모든 게 처리되고 비즈니스 로직이 도메인 쪽에 위치하지 못 하게 되는 것 같습니다. 애초에 도메인이라는 개념 자체가 없고 바로 JPA 엔티티를 만들고 @Service 어노테이션이 붙은 클래스에서 모든 걸 다 처리하는 거 같아요. 제가 국비 교육에서 배운 팀 프로젝트나 3개월 간 짧게 경험해 본 실무에서도 다 이렇게 코드를 짰던 거 같습니다. 공부하다보니 이런 걸 트랜잭션 스크립트 라고 하는 거 같더라구요.그런데 아무리 생각해도 이런 방식은 객체지향적이지 않다는 생각을 지울 수가 없었습니다. 제가 객체지향의 사실과 오해, 오브젝트 등에서 읽은 객체의 역할, 책임, 협력 이런 것들을 적용해보지 못 하는 것 같아서 객체지향적으로 코드를 짜는 것은 어떤 것일까 하는 갈망이 늘 있었습니다. 이런 갈망이 있어서 이번 강의를 더 간절히 기다렸던 거 같아요😀이번 강의는 스프링이나 데이터베이스를 전혀 사용하지 않고 순수 자바로만 객체지향에 대해서 설명을 해주셨는데요, 만약 스프링과 데이터베이스 기술(JPA) 등을 사용한다고 할 때는 어떻게 처리하시는 지 궁금합니다.이와 관련해서 제가 공부한 건 JPA 엔티티와 별개로 도메인 역할을 하는 클래스를 만들고 해당 클래스에서 비즈니스 로직을 처리하게 하고 도메인 객체를 JPA 엔티티로 변환해서 데이터베이스에 저장하는 방식이었습니다. (도메인 객체와 영속성 객체를 분리한 것이라고 할 수 있을 거 같습니다.) 이렇게 하면 도메인 객체 안에 있는 비즈니스 로직을 단위 테스트 하기도 쉽고(도메인 객체는 순수 자바(코틀린) 코드로만 돼 있으니까요!) 데이터베이스 중심적이지 않고 도메인 중심적으로 생각을 할 수 있는 것 같다는 인상을 받았습니다.다만 이렇게 할 때는 어떤 개념을 통해 도메인을 추출해야할 지, 그리고 책임을 어떤 도메인에 넣어야 할 지 고민할 게 많더라구요. 근데 약간 소설의 등장인물을 설정하는 거 같아서 재미는 있었습니다 ㅎㅎ 이렇게 접근을 하니 @Service 어노테이션이 붙은 클래스는 단순히 객체들이 모여서 서로 협력할 수 있게 해주는 광장(?) 이라고 해야될까요, 중개해주는 역할만 하게 되는 것 같다는 생각을 해보기도 했습니다.이러다 보니 DDD 에 대해서도 많이 관심을 갖게 됐습니다. 도메인 위주로 설계 하고 도메인에게 적절한 역할을 할당하는 방식인 거 같아서요. 그리고 아키텍처에도 많이 관심이 생기더라구요. 단순히 Controller -> Service -> Repositoy 구조의 레이어드 아키텍처에선 처음 언급한 문제를 해결하는게 쉽지 않아 보였거든요. 주절주절 질문이 길었는데 요약을 해보자면 다음과 같습니다. 스프링, JPA 같은 기술과 접목했을 때 이번 강의에서 배운 추상, 객체지향적 개발 방식을 어떻게 적용할 수 있을까요?이후로 공부할 만한 주제로 DDD, 아키텍처 등이 적절할까요? 비전공으로 혼자서 백엔드 개발자 취업 준비 중이라 질문할 곳이 마땅치 않아 여기에 이렇게 남기는 점 미리 양해를 구합니다😭
-
미해결다양한 사례로 익히는 SQL 데이터 분석
백업파일 테이블 생성 오류
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.주신 백업 파일로 같은 버전으로 받아서 데이터베이스에 업로드 했는데 테이블이 생성되지 않습니다. 스키마도요. 아무리 이리저리 해봐도 바뀌지 않아서 방법을 여쭤봅니다
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
java.lang.Thread$Builder 에러
스프링 mvc 1편을 들으며, 라이브 코딩하고 있는 수강생입니다. 13강 HttpServletRequest - 기본 사용법 강좌의 7분 46분 내용까지 코딩을 따라서 쳐본 후, 프로그램을 구동했더니 java.lang.ClassNotFoundException: java.lang.Thread$Builder at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[na:na] at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na] 다음과 같은 에러가 로그창에 떠있습니다. 왜 이런거죠?...해결법을 모르겠습니다
-
미해결프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)
강의자료 부탁드립니다.
강의 자료 부탁드립니다.jmpark@amorepacific.com
-
미해결실전! Querydsl
컬렉션 조회 최적화와 동적쿼리에 대한 질문입니다
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요.안녕하세요 강사님! 최근 JPA2 에서 수강한 컬렉션 최적화와 QueryDSL을 통해서 주변 병원 조회 기능을 구현하던중에 궁금한것이 생겨서 질문남깁니다.현재 @Entity @Getter @AllArgsConstructor @NoArgsConstructor(access = AccessLevel.PROTECTED) @SQLDelete(sql = "UPDATE store SET store_status = 'DEACTIVATE' WHERE store_id=?") @SQLRestriction("store_status = 'ACTIVATE'") @Inheritance(strategy = InheritanceType.JOINED) @DiscriminatorColumn // 하위 테이블의 구분 컬럼 생성 @Table(name = "store", indexes = { @Index(name = "idx_store_name", columnList = "storeName") }) public abstract class Store extends BaseEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "store_id") private Long storeId; @NotNull @Size(min = 2) @Column(nullable = false) private String storeName; private String storePhone; private String thumbnailUrl; private String notice; private String websiteLink; @Column(columnDefinition = "TEXT") private String storeInfo; private String storeInfoPhoto; @Enumerated(EnumType.STRING) private BaseStatus storeStatus; @Embedded private Address address; @OneToMany(mappedBy = "store", fetch = FetchType.LAZY) private List<BusinessHour> businessHours = new ArrayList<>(); @OneToMany(mappedBy = "store", fetch = FetchType.LAZY) private List<StorePhoto> storePhotos = new ArrayList<>(); // @OneToMany(mappedBy = "store", fetch = FetchType.LAZY) // private List<Reserve> reserves = new ArrayList<>(); @OneToMany(mappedBy = "store", fetch = FetchType.LAZY) private List<Review> reviews = new ArrayList<>(); @OneToOne(mappedBy = "store", fetch = FetchType.LAZY, cascade = CascadeType.ALL, optional = false) private RegistrationInfo registrationInfo; } 현재 이런식으로 Store 엔티티가 준비되어 있는 상황입니다.아래는 이를 상속한 Hospital 엔티티입니다.@Entity @Getter @Builder @NoArgsConstructor(access = AccessLevel.PROTECTED) @AllArgsConstructor @DiscriminatorValue("H") @OnDelete(action = OnDeleteAction.CASCADE) @Table(name = "hospital") public class Hospital extends Store { private String additionalServiceTag; @OneToMany(mappedBy = "hospital", fetch = FetchType.LAZY) private List<TagMapper> tags = new ArrayList<>(); }변경전 코드List<StoreQueryInfo> hospitalInfoList = jpaQueryFactory .select( Projections.constructor( StoreQueryInfo.class, hospital.storeId.as("storeId"), hospital.storeName.as("storeName"), hospital.thumbnailUrl.as("thumbnailUrl"), businessHour.startTime.as("startTime"), businessHour.endTime.as("endTime"), businessHour.breakStartTime.as("breakStartTime"), businessHour.breakEndTime.as("breakEndTime"), review.reviewId.count().as("reviewCount"), review.rating.avg().as("ratingAvg"), Expressions.stringTemplate( "ST_Distance_Sphere(ST_PointFromText({0}, 4326), {1})", point, hospital.address.point ).castToNum(Double.class).as("distance") ) ).from(hospital) .leftJoin(hospital.businessHours, businessHour) .on(businessHour.dayOfWeek.eq(dayOfWeek)) .leftJoin(hospital.reviews, review) .leftJoin(hospital.tags, tagMapper) .leftJoin(tagMapper.hospitalTag, hospitalTag) .where( inDistance(point, queryCond.radius()), businessHourEq(queryCond.businessHourCond()), specialitiesEq(queryCond.specialitiesCond()), emergencyEq(queryCond.emergencyCond()), isOpen(queryCond.openCond(), Time.valueOf(now.minusHours(4))) ) .groupBy( hospital.storeId, hospital.storeName, businessHour.startTime, businessHour.endTime, businessHour.breakStartTime, businessHour.breakEndTime ) .orderBy(Expressions.stringTemplate( "ST_Distance_Sphere(ST_PointFromText({0}, 4326), {1})", point, hospital.address.point ).asc()) .fetch();변경 후 코드 (변경전의 동적쿼리 미적용)public List<StoreQueryTotalInfo> findHospitalOptimization( Pageable pageable, int dayOfWeek, String point, LocalTime now, HospitalQueryCond queryCond) { NumberPath<Double> distanceAlias = Expressions.numberPath(Double.class, "distance"); // 일단 반경 내의 병원 정보를 모두 가져옴. List<Tuple> hospitals = jpaQueryFactory .select( hospital, Expressions.stringTemplate( "ST_Distance_Sphere(ST_PointFromText({0}, 4326), {1})", point, hospital.address.point ).castToNum(Double.class).as(distanceAlias) ).from(hospital) .leftJoin(hospital.registrationInfo, registrationInfo).fetchJoin() .where(inDistance(point, queryCond.radius())) .fetch(); // // 병원 돌면서 DTO 채우기 List<TestDTO> list = new ArrayList<>(); for (Tuple tuple : hospitals) { Hospital hospital1 = tuple.get(hospital); Double distance = tuple.get(distanceAlias); log.info("Hospital: " + hospital1 + ", Distance: " + distance); list.add(TestDTO.builder() .storeId(hospital1.getStoreId()) .storeName(hospital1.getStoreName()) .thumbnailUrl(hospital1.getThumbnailUrl()) .time(Times.of(hospital1.getBusinessHours(), dayOfWeek)) .reviewCount((long) hospital1.getReviews().size()) .ratingAvg(Review.getRatingAvg(hospital1.getReviews())) .distance(formatDistance(distance)) .tags(TagInfo.from(hospital1.getTags())) .build()); } return null; }강의를 듣기 전에는 @OneToMany 관계까지 모두 leftJoin()을 이용해서 데이터를 가져왔는데 쿼리가 무진장 많이 나가는 상황이 발생하더라고요.그래서 컬렉션 쿼리 최적화 수업을 들은 후 위의 코드로 변경하였습니다. (@ToOne 관계만 fetchJoin 하기, @OneToMany 관계는 가져와진 객체에 직접 접근해서 가져오는 방식으로 진행했습니다.) 근데 이때 동적쿼리를 어떤식으로 적용해야하는지 감이 잡히지 않더라고요..! 일단 원하는 반경 내의 병원을 모두 조회해서 가져오기 repository단에서 반복문을 돌면서 queryCond의 null값을 체크하며 수동으로 동적쿼리를 적용해야 하기 (코드단에서 동적쿼리 적용)위의 방식을 생각하고 있는데 이게 과연 동적 쿼리(?)가 맞는지 의구심이 들더라고요. 적용해야 하는 동적쿼리는 아래 코드와 같습니다.private BooleanExpression businessHourEq(String businessHourCond) { return businessHourCond != null ? hospitalTag.tagType.eq(HospitalTagType.BUSINESSHOUR).and(hospitalTag.tagContent.eq(businessHourCond)) : null; } private BooleanExpression specialitiesEq(String specialitiesCond) { return specialitiesCond != null ? hospitalTag.tagType.eq(HospitalTagType.SPECIALITIES).and(hospitalTag.tagContent.eq(specialitiesCond)) : null; } private BooleanExpression emergencyEq(String emergencyCond) { return emergencyCond.equals("EMERGENCY") ? hospitalTag.tagType.eq(HospitalTagType.EMERGENCY).and(hospitalTag.tagContent.eq(emergencyCond)) : null; } private BooleanExpression inDistance(String point, Integer radius) { return radius != null ? Expressions.booleanTemplate( "ST_Contains(ST_Buffer(ST_PointFromText({0}, 4326), {1}), {2})", point, radius, hospital.address.point ) : null; } private BooleanExpression isOpen(String isOpen, Time now) { return isOpen.equals("OPEN") ? businessHour.startTime.isNotNull().and(businessHour.endTime.isNotNull()) .and(businessHour.startTime.loe(now)).and(businessHour.endTime.goe(now)) : null; }