In this chapter we described the Java Persistence Query Language or JPQL.
JPQL is similar to the SQL language for querying relational databases. However, JPQL queries are expressed in Java objects rather than tables and columns. We looked at examples of simple queries and queries with conditional expressions using WHERE
clauses. We described aggregate functions including the GROUP BY
and HAVING
clause.
We saw examples of joins and subqueries. JPQL provides a number of functions which may be used in the WHERE
or HAVING
clause of a query. Queries can also have positional or named parameters and we saw examples of these. We covered bulk update and delete operations.
Finally JPQL provides a Native SQL feature which enables one to use proprietary database SQL features such as accessing stored procedures.