About paging
Setting and Tuning of JPA Queries
Explains various JPA query settings - result range, flush and lock.... methods support the implementation of efficient result paging. For example, if each result page should show exactly pageSize ...
JPA Criteria API Queries
Explains how to use the JPA Criteria API (CriteriaBuilder, CriteriaQuery, etc.) to build JPQL like queries. The JPA Criteria API provides an alternative way for defining JPA queries, which is mainly useful for building dynamic queries whose exact structure is only known at runtime. This page covers the following topics: JPA Cr ...
JPA Metamodel API
Explains how to use the JPA Metamodel API to retrieve details on the types and attributes of the persistent object model. The JPA Metamodel API provides the ability to examine the persistent object model and retrieve details on managed classes and persistent fields and properties, similarly to the ability that Java reflection provides for general Java types. ...
Storing JPA Entity Objects
Explains how to use JPA to store (persist) entity objects in the database. New entity objects can be stored in the database either explicitly by invoking the persist persist(entity) EntityManager's method Make an instance managed and persistent. See JavaDoc Reference Page... method or ...
SELECT clause (JPQL / Criteria API)
Explains how to use the SELECT clause and projections in a JPA/JPQL query. The ability to retrieve managed entity objects is a major advantage of JPQL. For example, the following query returns Country objects that become managed by the EntityManager javax.persistence.EntityManager JPA interface Inte ...
Index Definition
Describes how to define indexes in JPA entity classes and explains how indexes are used in JPQL queries. Querying without indexes requires iteration over entity objects in the database one by one. This may take a significant amount of time if many entity objects have to be examined. Using proper indexes the iteration can be avoided and complex queries ov ...
Numbers in JPQL and Criteria Queries
Shows how numbers, arithmetic expressions and numeric functions and operators (MOD, ABS) can be used in JPQL queries. Numeric values may appear in JPQL queries in many forms: as numeric literals - e.g. 123 , -12.5 . as parameters - when numeric values are assigned as arguments. as path expressions ...
Strings in JPQL and Criteria Queries
Explains string expressions in JPQL queries, including LIKE, LOCATE, LOWER, UPPER, TRIM, CONCAT and SUBSTRING. String values may appear in JPQL queries in various forms: as string literals - e.g. 'abc' , ''. as parameters - when string values are assigned as arguments. as path e ...
JPA Query Expressions (JPQL / Criteria)
Describes JPA query (JPQL / Criteria API) expressions (literals, operators and functions). Query expressions are the foundations on which JPQL and criteria queries are built. Every query consists of clauses - SELECT, FROM, WHERE, GROUP BY, HAVING and ORDER BY, and each clause consists of JPQL / Criteria query expressions. ...