SlideShare a Scribd company logo
1 of 26
Spring Data JPA
+ Hibernate
+ QueryDSL
ORM 을 사용하는데
쉬운 방법을 제공
참고:
좌충우돌 ORM 개발기 | Devon 2012
http://www.slideshare.net/daumdna/devon
-2012-b4-orm
2012년 8월 국내 구글검색
2012년 8월 전세계 구글검색
Spring Data
데이터를 다루는데 필요한,
기본 인터페이스를 정의함.
구현체도 제공
Spring Data JPA, MongoDB,
REDIS, SOLR, ElasticSerch 등
JPA
자바에서 제정한,
ORM 관련 표준 스펙
구현체로는
Hibernate, EclipseLINK 등
JPA 장점
- 쿼리를 만들지 않으니, DB 벤더에 종속
적이지 않다.
- 단순 테이블 매핑 정도라면, 쉽게 구현
가능
- 순수한 모델 객체를 지향하는
Persistence 코딩 패턴을 따라갈 수 있
다.
JPA 단점
- 10ms 튜닝이 중요한 서비스
- N+1 성능 문제. 쿼리가 100개가 동시에
날아간다.
- 쿼리를 먼저 생각하고, 코딩하면 어렵다.
특히 JOIN
일반적인 MVC-DAO 패턴
SERVICE
DAO
=Interface=
DAOImpl
=Implements=
Spring DATA-JPA DAO 패턴
SERVICE
DAO
=Interface=
DAOImpl
=Implements=
JPA 를 이용한 DAO 구현
* TABLE – CLASS 매핑
TV_SECTION
TABLE
TvSection
Entity Class
JPA 를 이용한 DAO 구현
* TABLE – CLASS 매핑
@Entity
@Table(name="tv_section")
public class TvSection {
@Id
@Column(name = "tv_program_id")
private long tvProgramId;
private int channel;
JPA 를 이용한 DAO 구현
* DAO 인터페이스 만들기
@Repository
public interface TvSectionRepository
extends
PagingAndSortingRepository<TvSection,
Long> {
}
JPA 를 이용한 DAO 구현
* 결과 가져오기
tvSectionRepository.findAll();
JPA 를 이용한 DAO 구현
• 원리 - 1
DAO 인터페이스만 정의하면
하위 구현은 Spring Data JPA 가 알아서..
컨텍스트가 로딩이 될때,
내가 정의한 쿼리를 생성해둡니다.
JPA 를 이용한 DAO 구현
• 원리 - 2
대부분의 CRUD 가 해결된 구현체가 존재합
니다.
PagingAndSortingRepository – 페이징 기능
CrudRepository – CRUD 기능
Repository - 기본
JPA 를 이용한 DAO 구현
• 페이징 결과 가져오기
Sort sort = new Sort(
new Order(Direction.DESC, "lastmodified")
);
Pageable pageable =
new PageRequest(0, 10, sort);
tvSectionRepository.findAll(pageable);
JPA 를 이용한 DAO 구현
• 조건문 추가하기 -1
@Repository
public interface TvSectionRepository extends
PagingAndSortingRepository<TvSection, Long> {
TvSection findByTvProgramId(long Id);
}
JPA 를 이용한 DAO 구현
• 조건문 추가하기 – Method 이름을 사용
And findByLastnameAndFirstname
… where x.lastname = ?1 and x.firstname = ?2
Or findByLastnameOrFirstname
… where x.lastname = ?1 or x.firstname = ?2
Between findByStartDateBetween
… where x.startDate between 1? and ?2
Like findByFirstnameLike
… where x.firstname like ?1
JPA 를 이용한 DAO 구현
• 테이블을 여러 개 조인하고 수많은 조건
문이 있는 경우라면…
findByLastnameAndFirstnameOrDateB
etweenChannelLikeLastnameNotInStar
tDate(String a, String b, Date c, …..)
JPA 를 이용한 DAO 구현
• 조건문 추가하기 – Spec 을 지정
- CriteriaBuilder 를 이용하기
- QueryDSL을 이용하기
tvSectionRepository.findAll(spec, pageable);
JPA 를 이용한 DAO 구현
• 조건문 추가하기 – CriteriaBuilder
CriteriaBuilder cb = entityManager.getCriteriaBuilder();
CriteriaQuery<Order> cq =
cb.createQuery(Order.class);
SetJoin<Order, Item> itemNode =
cq.from(Order.class).join(Order_.items);
cq.where( cb.equal(itemNode.get(Item_.id), 5 ) )
.distinct(true);
JPA 를 이용한 DAO 구현
• 조건문 추가하기 – CriteriaBuilder
CriteriaBuilder cb = entityManager.getCriteriaBuilder();
CriteriaQuery<Order> cq =
cb.createQuery(Order.class);
SetJoin<Order, Item> itemNode =
cq.from(Order.class).join(Order_.items);
cq.where( cb.equal(itemNode.get(Item_.id), 5 ) )
.distinct(true);
JPA 를 이용한 DAO 구현
• 조건문 추가하기 – QueryDSL
QTvSection.tvSection.channel.eq(value);
QTvSection.tvSection.title.like(value)
JPA 를 이용한 DAO 구현
• 조건문 추가하기 – QueryDSL
BooleanBuilder builder = new BooleanBuilder();
builder.and( QTvSection.tvSection.channel.eq(value) );
builder.and( QTvSection.tvSection.titleKo.like(value) );
builder.and( QTvSection.tvSection.titleKo.isNotNull() );
repository.findAll(builder.getValue(), pageable);
질문해주세요….ㄷㄷ

More Related Content

What's hot

좌충우돌 ORM 개발기 | Devon 2012
좌충우돌 ORM 개발기 | Devon 2012좌충우돌 ORM 개발기 | Devon 2012
좌충우돌 ORM 개발기 | Devon 2012
Daum DNA
 

What's hot (20)

[162] jpa와 모던 자바 데이터 저장 기술
[162] jpa와 모던 자바 데이터 저장 기술[162] jpa와 모던 자바 데이터 저장 기술
[162] jpa와 모던 자바 데이터 저장 기술
 
ORM을 활용할 경우의 설계, 개발 과정
ORM을 활용할 경우의 설계, 개발 과정ORM을 활용할 경우의 설계, 개발 과정
ORM을 활용할 경우의 설계, 개발 과정
 
Scala, Spring-Boot, JPA의 불편하면서도 즐거운 동거
Scala, Spring-Boot, JPA의 불편하면서도 즐거운 동거Scala, Spring-Boot, JPA의 불편하면서도 즐거운 동거
Scala, Spring-Boot, JPA의 불편하면서도 즐거운 동거
 
Jpa 잘 (하는 척) 하기
Jpa 잘 (하는 척) 하기Jpa 잘 (하는 척) 하기
Jpa 잘 (하는 척) 하기
 
좌충우돌 ORM 개발기 | Devon 2012
좌충우돌 ORM 개발기 | Devon 2012좌충우돌 ORM 개발기 | Devon 2012
좌충우돌 ORM 개발기 | Devon 2012
 
Ksug2015 - JPA3, JPA 내부구조
Ksug2015 - JPA3, JPA 내부구조Ksug2015 - JPA3, JPA 내부구조
Ksug2015 - JPA3, JPA 내부구조
 
자바야 놀자 PPT
자바야 놀자 PPT자바야 놀자 PPT
자바야 놀자 PPT
 
MyBatis에서 JPA로
MyBatis에서 JPA로MyBatis에서 JPA로
MyBatis에서 JPA로
 
DDD 구현기초 (거의 Final 버전)
DDD 구현기초 (거의 Final 버전)DDD 구현기초 (거의 Final 버전)
DDD 구현기초 (거의 Final 버전)
 
엘라스틱 서치 세미나
엘라스틱 서치 세미나엘라스틱 서치 세미나
엘라스틱 서치 세미나
 
검색 서비스 간략 교육
검색 서비스 간략 교육 검색 서비스 간략 교육
검색 서비스 간략 교육
 
3-1. css
3-1. css3-1. css
3-1. css
 
자바모델 클래스에 날개를달자_롬복(Lombok)
자바모델 클래스에 날개를달자_롬복(Lombok)자바모델 클래스에 날개를달자_롬복(Lombok)
자바모델 클래스에 날개를달자_롬복(Lombok)
 
[D2 campus seminar]스칼라를 통한 다양한 언어의 패러다임 맛보기
[D2 campus seminar]스칼라를 통한 다양한 언어의 패러다임 맛보기[D2 campus seminar]스칼라를 통한 다양한 언어의 패러다임 맛보기
[D2 campus seminar]스칼라를 통한 다양한 언어의 패러다임 맛보기
 
4-1. javascript
4-1. javascript4-1. javascript
4-1. javascript
 
SLiPP 서비스를 Java에서 Scala로 전환하면서 경험담
SLiPP 서비스를 Java에서 Scala로 전환하면서 경험담SLiPP 서비스를 Java에서 Scala로 전환하면서 경험담
SLiPP 서비스를 Java에서 Scala로 전환하면서 경험담
 
스프링프레임워크 & 마이바티스 ☆ 무.료 강의자료 제공 中
스프링프레임워크 & 마이바티스 ☆ 무.료 강의자료 제공 中스프링프레임워크 & 마이바티스 ☆ 무.료 강의자료 제공 中
스프링프레임워크 & 마이바티스 ☆ 무.료 강의자료 제공 中
 
[ 하코사세미나] 의외로 쉬운 D3 그래프 퍼블리싱
[ 하코사세미나] 의외로 쉬운 D3 그래프 퍼블리싱[ 하코사세미나] 의외로 쉬운 D3 그래프 퍼블리싱
[ 하코사세미나] 의외로 쉬운 D3 그래프 퍼블리싱
 
Jquery javascript_ed10
Jquery javascript_ed10Jquery javascript_ed10
Jquery javascript_ed10
 
[오픈소스컨설팅]MyBatis Basic
[오픈소스컨설팅]MyBatis Basic[오픈소스컨설팅]MyBatis Basic
[오픈소스컨설팅]MyBatis Basic
 

Viewers also liked

If You Build It, They Will Come: Institutional implementation of Mahara
If You Build It, They Will Come: Institutional implementation of MaharaIf You Build It, They Will Come: Institutional implementation of Mahara
If You Build It, They Will Come: Institutional implementation of Mahara
Daniel Clark
 
Greatest moments of soccer in guayaquil
Greatest moments of soccer in guayaquilGreatest moments of soccer in guayaquil
Greatest moments of soccer in guayaquil
ALEX CUESTA SALAZAR
 
Towson University: COOP: Conduct of Classes During Campus Closings
Towson University: COOP: Conduct of Classes During Campus ClosingsTowson University: COOP: Conduct of Classes During Campus Closings
Towson University: COOP: Conduct of Classes During Campus Closings
Lindsey Landolfi
 
Before and after shots
Before and after shotsBefore and after shots
Before and after shots
CousticGloVic
 
Gender is refers to as a social aspects and opportunities associated with bei...
Gender is refers to as a social aspects and opportunities associated with bei...Gender is refers to as a social aspects and opportunities associated with bei...
Gender is refers to as a social aspects and opportunities associated with bei...
Sharp Shooter
 
Nihaya mujib putri (092111213)
Nihaya mujib putri (092111213)Nihaya mujib putri (092111213)
Nihaya mujib putri (092111213)
nayaputri
 
Journey toward Learning Society: Possibilities and challenges of Viet Nam Li...
Journey toward Learning Society: Possibilities and challenges of Viet Nam Li...Journey toward Learning Society: Possibilities and challenges of Viet Nam Li...
Journey toward Learning Society: Possibilities and challenges of Viet Nam Li...
Zakir Hossain/ICS, Zurich
 

Viewers also liked (18)

자바 웹 개발 시작하기 (10주차 : ㅌㅗㅇ ㅎㅏ ㄹㅏ)

자바 웹 개발 시작하기 (10주차 : ㅌㅗㅇ ㅎㅏ ㄹㅏ)
자바 웹 개발 시작하기 (10주차 : ㅌㅗㅇ ㅎㅏ ㄹㅏ)

자바 웹 개발 시작하기 (10주차 : ㅌㅗㅇ ㅎㅏ ㄹㅏ)

 
spring data jpa 간단한 튜토리얼
spring data jpa 간단한 튜토리얼spring data jpa 간단한 튜토리얼
spring data jpa 간단한 튜토리얼
 
Hroi linked in
Hroi linked inHroi linked in
Hroi linked in
 
The amazing rocky mountains
The amazing rocky mountainsThe amazing rocky mountains
The amazing rocky mountains
 
If You Build It, They Will Come: Institutional implementation of Mahara
If You Build It, They Will Come: Institutional implementation of MaharaIf You Build It, They Will Come: Institutional implementation of Mahara
If You Build It, They Will Come: Institutional implementation of Mahara
 
Greatest moments of soccer in guayaquil
Greatest moments of soccer in guayaquilGreatest moments of soccer in guayaquil
Greatest moments of soccer in guayaquil
 
Sbobet
SbobetSbobet
Sbobet
 
Towson University: COOP: Conduct of Classes During Campus Closings
Towson University: COOP: Conduct of Classes During Campus ClosingsTowson University: COOP: Conduct of Classes During Campus Closings
Towson University: COOP: Conduct of Classes During Campus Closings
 
Before and after shots
Before and after shotsBefore and after shots
Before and after shots
 
Gender is refers to as a social aspects and opportunities associated with bei...
Gender is refers to as a social aspects and opportunities associated with bei...Gender is refers to as a social aspects and opportunities associated with bei...
Gender is refers to as a social aspects and opportunities associated with bei...
 
Karlene Hoo Outlines NSF Innovation Programs
Karlene Hoo Outlines NSF Innovation ProgramsKarlene Hoo Outlines NSF Innovation Programs
Karlene Hoo Outlines NSF Innovation Programs
 
日本行政学会災害と科学技術研究部会発表資料
日本行政学会災害と科学技術研究部会発表資料日本行政学会災害と科学技術研究部会発表資料
日本行政学会災害と科学技術研究部会発表資料
 
Aggiungere l'emozione alla loyalty transazionale
Aggiungere l'emozione alla loyalty transazionaleAggiungere l'emozione alla loyalty transazionale
Aggiungere l'emozione alla loyalty transazionale
 
Nihaya mujib putri (092111213)
Nihaya mujib putri (092111213)Nihaya mujib putri (092111213)
Nihaya mujib putri (092111213)
 
Journey toward Learning Society: Possibilities and challenges of Viet Nam Li...
Journey toward Learning Society: Possibilities and challenges of Viet Nam Li...Journey toward Learning Society: Possibilities and challenges of Viet Nam Li...
Journey toward Learning Society: Possibilities and challenges of Viet Nam Li...
 
Current Landscape of CEO Long-Term Incentives
Current Landscape of CEO Long-Term IncentivesCurrent Landscape of CEO Long-Term Incentives
Current Landscape of CEO Long-Term Incentives
 
Prezi
PreziPrezi
Prezi
 
Introduction to Marketing for Managers
Introduction to Marketing for ManagersIntroduction to Marketing for Managers
Introduction to Marketing for Managers
 

Similar to Spring data jpa

Jpa 쿼리 포함 자료
Jpa 쿼리 포함 자료Jpa 쿼리 포함 자료
Jpa 쿼리 포함 자료
Hyosang Hong
 

Similar to Spring data jpa (20)

(IT실무교육/국비지원교육/자바/스프링교육추천)#15.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)
(IT실무교육/국비지원교육/자바/스프링교육추천)#15.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)(IT실무교육/국비지원교육/자바/스프링교육추천)#15.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)
(IT실무교육/국비지원교육/자바/스프링교육추천)#15.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)
 
[스프링 스터디 3일차] 데이터엑세스기술
[스프링 스터디 3일차] 데이터엑세스기술[스프링 스터디 3일차] 데이터엑세스기술
[스프링 스터디 3일차] 데이터엑세스기술
 
[JPA학원추천]spring framework&jpa활용한프로그램구현재직자향상과정_JPA학원/스프링학원/IT학원추천/재직자교육/국비지원/재...
[JPA학원추천]spring framework&jpa활용한프로그램구현재직자향상과정_JPA학원/스프링학원/IT학원추천/재직자교육/국비지원/재...[JPA학원추천]spring framework&jpa활용한프로그램구현재직자향상과정_JPA학원/스프링학원/IT학원추천/재직자교육/국비지원/재...
[JPA학원추천]spring framework&jpa활용한프로그램구현재직자향상과정_JPA학원/스프링학원/IT학원추천/재직자교육/국비지원/재...
 
[246] foursquare데이터라이프사이클 설현준
[246] foursquare데이터라이프사이클 설현준[246] foursquare데이터라이프사이클 설현준
[246] foursquare데이터라이프사이클 설현준
 
Mongodb and spatial
Mongodb and spatialMongodb and spatial
Mongodb and spatial
 
2007년 제8회 JCO 컨퍼런스 POJO 프로그래밍 발표 자료
2007년 제8회 JCO 컨퍼런스 POJO 프로그래밍 발표 자료2007년 제8회 JCO 컨퍼런스 POJO 프로그래밍 발표 자료
2007년 제8회 JCO 컨퍼런스 POJO 프로그래밍 발표 자료
 
Introduction to Apache Tajo
Introduction to Apache TajoIntroduction to Apache Tajo
Introduction to Apache Tajo
 
Fundamentals of Oracle SQL
Fundamentals of Oracle SQLFundamentals of Oracle SQL
Fundamentals of Oracle SQL
 
Spring batch와 함께 하는 TDD
Spring batch와 함께 하는 TDDSpring batch와 함께 하는 TDD
Spring batch와 함께 하는 TDD
 
하둡 좋은약이지만 만병통치약은 아니다
하둡 좋은약이지만 만병통치약은 아니다하둡 좋은약이지만 만병통치약은 아니다
하둡 좋은약이지만 만병통치약은 아니다
 
Java naming strategy (자바 명명 전략)
Java naming strategy (자바 명명 전략)Java naming strategy (자바 명명 전략)
Java naming strategy (자바 명명 전략)
 
Big data analysis with R and Apache Tajo (in Korean)
Big data analysis with R and Apache Tajo (in Korean)Big data analysis with R and Apache Tajo (in Korean)
Big data analysis with R and Apache Tajo (in Korean)
 
Sql 중심 코드 탈피
Sql 중심 코드 탈피Sql 중심 코드 탈피
Sql 중심 코드 탈피
 
Sql 중심 코드 탈피 발표자료
Sql 중심 코드 탈피 발표자료Sql 중심 코드 탈피 발표자료
Sql 중심 코드 탈피 발표자료
 
실전 DataSnap!
실전 DataSnap!실전 DataSnap!
실전 DataSnap!
 
MySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptxMySQL_MariaDB-성능개선-202201.pptx
MySQL_MariaDB-성능개선-202201.pptx
 
Jpa 쿼리 포함 자료
Jpa 쿼리 포함 자료Jpa 쿼리 포함 자료
Jpa 쿼리 포함 자료
 
Jpa 쿼리 포함 자료
Jpa 쿼리 포함 자료Jpa 쿼리 포함 자료
Jpa 쿼리 포함 자료
 
안드로이드 빌드: 설탕없는 세계
안드로이드 빌드: 설탕없는 세계안드로이드 빌드: 설탕없는 세계
안드로이드 빌드: 설탕없는 세계
 
(Spring Data JPA)게시판 리스트보기_오라클, 스프링부트,페이지나누기
(Spring Data JPA)게시판 리스트보기_오라클, 스프링부트,페이지나누기(Spring Data JPA)게시판 리스트보기_오라클, 스프링부트,페이지나누기
(Spring Data JPA)게시판 리스트보기_오라클, 스프링부트,페이지나누기
 

Spring data jpa

  • 1. Spring Data JPA + Hibernate + QueryDSL
  • 2. ORM 을 사용하는데 쉬운 방법을 제공 참고: 좌충우돌 ORM 개발기 | Devon 2012 http://www.slideshare.net/daumdna/devon -2012-b4-orm
  • 3. 2012년 8월 국내 구글검색
  • 4. 2012년 8월 전세계 구글검색
  • 5. Spring Data 데이터를 다루는데 필요한, 기본 인터페이스를 정의함. 구현체도 제공 Spring Data JPA, MongoDB, REDIS, SOLR, ElasticSerch 등
  • 6. JPA 자바에서 제정한, ORM 관련 표준 스펙 구현체로는 Hibernate, EclipseLINK 등
  • 7. JPA 장점 - 쿼리를 만들지 않으니, DB 벤더에 종속 적이지 않다. - 단순 테이블 매핑 정도라면, 쉽게 구현 가능 - 순수한 모델 객체를 지향하는 Persistence 코딩 패턴을 따라갈 수 있 다.
  • 8. JPA 단점 - 10ms 튜닝이 중요한 서비스 - N+1 성능 문제. 쿼리가 100개가 동시에 날아간다. - 쿼리를 먼저 생각하고, 코딩하면 어렵다. 특히 JOIN
  • 10. Spring DATA-JPA DAO 패턴 SERVICE DAO =Interface= DAOImpl =Implements=
  • 11. JPA 를 이용한 DAO 구현 * TABLE – CLASS 매핑 TV_SECTION TABLE TvSection Entity Class
  • 12. JPA 를 이용한 DAO 구현 * TABLE – CLASS 매핑 @Entity @Table(name="tv_section") public class TvSection { @Id @Column(name = "tv_program_id") private long tvProgramId; private int channel;
  • 13. JPA 를 이용한 DAO 구현 * DAO 인터페이스 만들기 @Repository public interface TvSectionRepository extends PagingAndSortingRepository<TvSection, Long> { }
  • 14. JPA 를 이용한 DAO 구현 * 결과 가져오기 tvSectionRepository.findAll();
  • 15. JPA 를 이용한 DAO 구현 • 원리 - 1 DAO 인터페이스만 정의하면 하위 구현은 Spring Data JPA 가 알아서.. 컨텍스트가 로딩이 될때, 내가 정의한 쿼리를 생성해둡니다.
  • 16. JPA 를 이용한 DAO 구현 • 원리 - 2 대부분의 CRUD 가 해결된 구현체가 존재합 니다. PagingAndSortingRepository – 페이징 기능 CrudRepository – CRUD 기능 Repository - 기본
  • 17. JPA 를 이용한 DAO 구현 • 페이징 결과 가져오기 Sort sort = new Sort( new Order(Direction.DESC, "lastmodified") ); Pageable pageable = new PageRequest(0, 10, sort); tvSectionRepository.findAll(pageable);
  • 18. JPA 를 이용한 DAO 구현 • 조건문 추가하기 -1 @Repository public interface TvSectionRepository extends PagingAndSortingRepository<TvSection, Long> { TvSection findByTvProgramId(long Id); }
  • 19. JPA 를 이용한 DAO 구현 • 조건문 추가하기 – Method 이름을 사용 And findByLastnameAndFirstname … where x.lastname = ?1 and x.firstname = ?2 Or findByLastnameOrFirstname … where x.lastname = ?1 or x.firstname = ?2 Between findByStartDateBetween … where x.startDate between 1? and ?2 Like findByFirstnameLike … where x.firstname like ?1
  • 20. JPA 를 이용한 DAO 구현 • 테이블을 여러 개 조인하고 수많은 조건 문이 있는 경우라면… findByLastnameAndFirstnameOrDateB etweenChannelLikeLastnameNotInStar tDate(String a, String b, Date c, …..)
  • 21. JPA 를 이용한 DAO 구현 • 조건문 추가하기 – Spec 을 지정 - CriteriaBuilder 를 이용하기 - QueryDSL을 이용하기 tvSectionRepository.findAll(spec, pageable);
  • 22. JPA 를 이용한 DAO 구현 • 조건문 추가하기 – CriteriaBuilder CriteriaBuilder cb = entityManager.getCriteriaBuilder(); CriteriaQuery<Order> cq = cb.createQuery(Order.class); SetJoin<Order, Item> itemNode = cq.from(Order.class).join(Order_.items); cq.where( cb.equal(itemNode.get(Item_.id), 5 ) ) .distinct(true);
  • 23. JPA 를 이용한 DAO 구현 • 조건문 추가하기 – CriteriaBuilder CriteriaBuilder cb = entityManager.getCriteriaBuilder(); CriteriaQuery<Order> cq = cb.createQuery(Order.class); SetJoin<Order, Item> itemNode = cq.from(Order.class).join(Order_.items); cq.where( cb.equal(itemNode.get(Item_.id), 5 ) ) .distinct(true);
  • 24. JPA 를 이용한 DAO 구현 • 조건문 추가하기 – QueryDSL QTvSection.tvSection.channel.eq(value); QTvSection.tvSection.title.like(value)
  • 25. JPA 를 이용한 DAO 구현 • 조건문 추가하기 – QueryDSL BooleanBuilder builder = new BooleanBuilder(); builder.and( QTvSection.tvSection.channel.eq(value) ); builder.and( QTvSection.tvSection.titleKo.like(value) ); builder.and( QTvSection.tvSection.titleKo.isNotNull() ); repository.findAll(builder.getValue(), pageable);