Question

JPA Criteria API has some important limitations. For example:

  • no support for right-outer-join
  • support for left-outer-join only if the relation in the entities is in the same direction
  • no support for subquery neither in SELECT nor in FROM clauses

Does QueryDsl querydsl-jpa suffer from the same limitations?

What about QueryDsl querydsl-sql?

EDIT: From the QueryDsl documentation (no concrete experience with it), QueryDsl provides two query-classes JPAQuery and JPASQLQuery. The first seems to have the same limitation as JPA Criteria API, but JPASQLQuery doesn't seem. If I find time, I will dive deeper into code and try it. But if someone already knows something about it, then you are welcome!

Was it helpful?

Solution

You assumption is correct. Querydsl JPA has the same restrictions as the mentioned three restrictions are also restrictions of JPQL, the query language of JPA.

JPAQuery is for JPQL queries and JPASQLQuery is for JPA native (SQL) queries.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top