Is it true that JPA's CriteriaQuery uses JPQL?

Or does firing off JPQL queries use the Criteria API under the hood?


Criteria API is an entity query builder, so the final outcome is the JPQL. It makes lot of sense if you think about it.

JPQL is translated to SQL.

So, the flow goes like this:

  • JPQL -> SQL
  • Criteria API -> JPQL -> SQL
1 Like