About query
JPA Named Queries
Explains how to define and how to run JPA named queries. A named query is a statically defined query with a predefined unchangeable query string. Using named queries instead of dynamic queries may improve ...
Running JPA Queries
Explains how to use JPA to run Java Persistence Query Language (JPQL) queries. The Query javax.persistence.Query JPA interface Interface used to control query execution. See JavaDoc Reference Page... interface defines ...
JPA Criteria API Queries
Explains how to use the JPA Criteria API (CriteriaBuilder, CriteriaQuery, etc.) to build JPQL like queries.... JPA Criteria API vs JPQL First JPA Criteria Query Parameters in Criteria Queries Criteria Query Structure Criteria Query Expressions ...
JPA Query API
Describes the API that JPA provides for running queries against the database.... are represented in JPA 2 by two interfaces - the old Query javax.persistence.Query JPA interface Interface used to control query execution. ...
Setting and Tuning of JPA Queries
Explains various JPA query settings - result range, flush and lock. The Query javax.persistence.Query JPA interface Interface used to control query execution. See JavaDoc Reference Page... and ...
Query Parameters in JPA
Explains how to use parameters (named parameters and ordinal parameters) in JPA queries. Query parameters enable the definition of reusable queries. Such queries can be ... values to retrieve different results. Running the same query multiple times with different parameter values (arguments) is more efficient than using a new query string for every query execution, because it eliminates the need for ...
JPA Query Structure (JPQL / Criteria)
Explains the structure of a JPQL query, which consists of 6 clauses: SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY. The syntax of the Java Persistence Query Language (JPQL) is very similar to the syntax of SQL. Having a SQL like ... is an important advantage because SQL is a very powerful query language and many developers are already familiar with it. The ... works with Java classes and objects. For example, a JPQL query can retrieve and return entity objects rather than just field values from ...
JPA Queries
Reference (JavaDoc) of all the JPA query types, including Query, TypedQuery, CriteriaBuilder, CriteriaQuery, Tuple, Root, Expression, Order, etc. Queries are represented in JPA by the Query and TypedQuery interfaces: javax.persistence.Query javax.persistence.TypedQuery The JPA Query API ...
SELECT clause (JPQL / Criteria API)
Explains how to use the SELECT clause and projections in a JPA/JPQL query.... is a major advantage of JPQL. For example, the following query returns Country objects that become managed by the EntityManager ... See JavaDoc Reference Page... <Country> query = em. createQuery createQuery(qlString, resultClass) ...