hellzone
hellzone

Reputation: 5246

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).

Upvotes: 5

Views: 6221

Answers (2)

Timo Westkämper
Timo Westkämper

Reputation: 22190

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.

Upvotes: 11

M Rajoy
M Rajoy

Reputation: 4094

QueryDSL is a level of abstraction above criteria; Also, it is more similar to SQL so it might be easier to learn for people who have not touched Criteria before.

Upvotes: 2

Related Questions