Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hibernate: Criteria API vs. QueryDsl

I have some experience with Criteria API but I have never used QueryDsl before. What I want to ask is what are the advantages/disadvantages of using QueryDsl instead of Criteria API? Especially I want to learn which one is more suitable for huge databases(I mean complex queries).

like image 905
hellzone Avatar asked Jan 14 '15 10:01

hellzone


1 Answers

Querydsl is

  • more compact
  • more typesafe (at least compared to Hibernate Criteria)
  • closer to JPQL syntax
  • also available for other backends

This answer is biased since I am a Querydsl contributor.

like image 71
Timo Westkämper Avatar answered Oct 12 '22 18:10

Timo Westkämper