About @Query

manual

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 code organization by separating the JPQL query strings from the Java code. It also enforces the ...

 
manual

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 ...

 
manual

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 two methods for running SELECT queries: Query.getSingleRes ...

 
manual

JPA Query API

Describes the API that JPA provides for running queries against the database. Queries are represented in JPA 2 by two interfaces - the old Query javax.persistence.Query JPA interface Interface used to control query execution. See JavaDoc Reference Page... interface, which was the only interfac ...

 
manual

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  TypedQuery javax.persistence.TypedQuery JPA interface Inter ...

 
manual

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 executed with different parameter values to retrieve different results. Running the same query multiple times with different parameter values (arguments) is more efficie ...

 
api-jpa

javax.persistence.Query

Interface used to control query execution.(Interface of JPA)

 
api-jpa

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 section (in chapter 4 of the ObjectDB manual) provides ...

 
manual

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 syntax in JPA queries is an important advantage because SQL is a very powerful query language and many developers are already familiar wi ...

 
manual

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 ...