SlideShare a Scribd company logo
1 of 21
Download to read offline
JPA
Covenant
Chapter 5
JPA
JPQL Join Fetch
- Name. Covenant Ko
- Company. 11번가
- Github 용감한친구들 Organization Founder & Maintainer. https://github.com/brave-people
- Github. https://github.com/KoEonYack
- Tech Blog. https://covenant.tistory.com/ (누적 방문 51만)
(Cartesian Product)
JPQL Fetch Join ?
https://www.mathstopia.net/sets/cartesian-product
A×B = { (a,b) | aϵA and bϵB }
Cartesian Product is the multiplication of two sets to
form the set of all ordered pairs.
(Cartesian Product)
JPQL Fetch Join ?
1
1
1 *
1
*
1
1
1 *
1
*
1
1
1 *
1
*
1
1
1 *
1
*
Order Member Delivery
1
1
1 *
1
*
Order Member Delivery
?
1
1
1 *
1
*
Order Member Delivery
?
.
1
* 1
1
1
* *
1
1
* 1
1
1
* *
1
DB Order 2 OrderItem 2 ?
OrderA
OrderA
OrderB
OrderB
OrderItemA
OrderItemB
OrderItemA
OrderItemB
Distinct
1. SQL distinct row .
2. JPQL distinct Root Entity
Distinct
1. SQL distinct row .
2. JPQL distinct Root Entity
? No
Distinct
1. SQL distinct row .
2. JPQL distinct Root Entity
?
Distinct
1. SQL distinct row .
2. JPQL distinct Root Entity
? No
Distinct
1. SQL distinct row .
2. JPQL distinct Root Entity
? No
?
https://velog.io/@neity16/
?
https://velog.io/@neity16/
DB JPQL DISTINCT
1. ToOne(OneToOne, ManyToOne)
2.
3. hibernate default_batch_fetch_size or @BatchSize
JPA
Covenant
Chapter 5
JPA
JPQL Join Fetch

More Related Content

What's hot

WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016
WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016
WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016
崇之 清水
 
Learn REST API with Python
Learn REST API with PythonLearn REST API with Python
Learn REST API with Python
Larry Cai
 

What's hot (20)

떠먹는 '오브젝트' Ch05 책임 할당하기
떠먹는 '오브젝트' Ch05 책임 할당하기떠먹는 '오브젝트' Ch05 책임 할당하기
떠먹는 '오브젝트' Ch05 책임 할당하기
 
JPA 스터디 Week2 - Object Relational Mapping
JPA 스터디 Week2 - Object Relational MappingJPA 스터디 Week2 - Object Relational Mapping
JPA 스터디 Week2 - Object Relational Mapping
 
JPA Week4. VALUE TYPES / CQRS
JPA Week4. VALUE TYPES / CQRSJPA Week4. VALUE TYPES / CQRS
JPA Week4. VALUE TYPES / CQRS
 
떠먹는 '오브젝트' Ch04 설계 품질과 트레이드오프
떠먹는 '오브젝트' Ch04 설계 품질과 트레이드오프떠먹는 '오브젝트' Ch04 설계 품질과 트레이드오프
떠먹는 '오브젝트' Ch04 설계 품질과 트레이드오프
 
GREAT STEP 2. TDD & MockMVC
GREAT STEP 2. TDD & MockMVCGREAT STEP 2. TDD & MockMVC
GREAT STEP 2. TDD & MockMVC
 
GitGot: The Swiss Army Chainsaw of Git Repo Management
GitGot: The Swiss Army Chainsaw of Git Repo ManagementGitGot: The Swiss Army Chainsaw of Git Repo Management
GitGot: The Swiss Army Chainsaw of Git Repo Management
 
pg_chameleon a MySQL to PostgreSQL replica
pg_chameleon a MySQL to PostgreSQL replicapg_chameleon a MySQL to PostgreSQL replica
pg_chameleon a MySQL to PostgreSQL replica
 
pg_chameleon MySQL to PostgreSQL replica made easy
pg_chameleon  MySQL to PostgreSQL replica made easypg_chameleon  MySQL to PostgreSQL replica made easy
pg_chameleon MySQL to PostgreSQL replica made easy
 
The ninja elephant, scaling the analytics database in Transwerwise
The ninja elephant, scaling the analytics database in TranswerwiseThe ninja elephant, scaling the analytics database in Transwerwise
The ninja elephant, scaling the analytics database in Transwerwise
 
WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016
WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016
WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016
 
Gittalk
GittalkGittalk
Gittalk
 
Life on a_rollercoaster
Life on a_rollercoasterLife on a_rollercoaster
Life on a_rollercoaster
 
Git Real
Git RealGit Real
Git Real
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
 
Cutting Code Quickly - LLEWELLYN FALCO
Cutting Code Quickly - LLEWELLYN FALCOCutting Code Quickly - LLEWELLYN FALCO
Cutting Code Quickly - LLEWELLYN FALCO
 
Cutting code quickly
Cutting code quicklyCutting code quickly
Cutting code quickly
 
Learn REST API with Python
Learn REST API with PythonLearn REST API with Python
Learn REST API with Python
 
DEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and Python
DEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and PythonDEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and Python
DEVNET-1001 Coding 101: How to Call REST APIs from a REST Client and Python
 
Pg chameleon, mysql to postgresql replica made easy
Pg chameleon, mysql to postgresql replica made easyPg chameleon, mysql to postgresql replica made easy
Pg chameleon, mysql to postgresql replica made easy
 
Git real slides
Git real slidesGit real slides
Git real slides
 

Similar to JPA Week5. Join Fetch

Similar to JPA Week5. Join Fetch (9)

Enjoy privacy on Gitlab
Enjoy privacy on GitlabEnjoy privacy on Gitlab
Enjoy privacy on Gitlab
 
Pragmatic Patterns (and Pitfalls) for Event Streaming in Brownfield Environme...
Pragmatic Patterns (and Pitfalls) for Event Streaming in Brownfield Environme...Pragmatic Patterns (and Pitfalls) for Event Streaming in Brownfield Environme...
Pragmatic Patterns (and Pitfalls) for Event Streaming in Brownfield Environme...
 
Z Garbage Collector
Z Garbage CollectorZ Garbage Collector
Z Garbage Collector
 
GPDB Meetup GPORCA OSS 101
GPDB Meetup GPORCA OSS 101GPDB Meetup GPORCA OSS 101
GPDB Meetup GPORCA OSS 101
 
Spring ME JavaOne
Spring ME JavaOneSpring ME JavaOne
Spring ME JavaOne
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
 
Spark Streaming Tips for Devs and Ops
Spark Streaming Tips for Devs and OpsSpark Streaming Tips for Devs and Ops
Spark Streaming Tips for Devs and Ops
 
Spark Streaming Tips for Devs and Ops by Fran perez y federico fernández
Spark Streaming Tips for Devs and Ops by Fran perez y federico fernándezSpark Streaming Tips for Devs and Ops by Fran perez y federico fernández
Spark Streaming Tips for Devs and Ops by Fran perez y federico fernández
 
Getting Git Right
Getting Git RightGetting Git Right
Getting Git Right
 

More from Covenant Ko

More from Covenant Ko (8)

정원사를 마치며: 100일간의 병아리 개발자의 성장 이야기
정원사를 마치며: 100일간의 병아리 개발자의 성장 이야기정원사를 마치며: 100일간의 병아리 개발자의 성장 이야기
정원사를 마치며: 100일간의 병아리 개발자의 성장 이야기
 
왜 개발자는 컴퓨터공학을 공부해야 할까? (비전공자는 컴퓨터공학 과목에서 무엇을 알아야할까?)
왜 개발자는 컴퓨터공학을 공부해야 할까? (비전공자는 컴퓨터공학 과목에서 무엇을 알아야할까?)왜 개발자는 컴퓨터공학을 공부해야 할까? (비전공자는 컴퓨터공학 과목에서 무엇을 알아야할까?)
왜 개발자는 컴퓨터공학을 공부해야 할까? (비전공자는 컴퓨터공학 과목에서 무엇을 알아야할까?)
 
떠먹는 '오브젝트' Ch03 역할, 책임, 협력
떠먹는 '오브젝트' Ch03 역할, 책임, 협력떠먹는 '오브젝트' Ch03 역할, 책임, 협력
떠먹는 '오브젝트' Ch03 역할, 책임, 협력
 
Week6 autowired beanlifecycle
Week6 autowired beanlifecycleWeek6 autowired beanlifecycle
Week6 autowired beanlifecycle
 
Week5 컴포넌트 스캔
Week5 컴포넌트 스캔Week5 컴포넌트 스캔
Week5 컴포넌트 스캔
 
Week4 빈은 전설이다. (싱글톤 빈, CGlib)
Week4 빈은 전설이다. (싱글톤 빈, CGlib)Week4 빈은 전설이다. (싱글톤 빈, CGlib)
Week4 빈은 전설이다. (싱글톤 빈, CGlib)
 
Week3 아주 작은 빈 이야기 2
Week3 아주 작은 빈 이야기 2Week3 아주 작은 빈 이야기 2
Week3 아주 작은 빈 이야기 2
 
Week1 스프링이 사랑한 SOLID
Week1 스프링이 사랑한 SOLIDWeek1 스프링이 사랑한 SOLID
Week1 스프링이 사랑한 SOLID
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

JPA Week5. Join Fetch