About named queries

11-20 of 200Refresh
Manual
69

Chapter 4 - JPA Queries (JPQL / Criteria) [2011-04-01]

(named) queries. It explains how to use the relevant interfaces, annotations, enums and methods ... The JPA Query Language (JPQL) can be considered as an object oriented version of SQL. Users ... well as how to use the JPA Criteria API, which provides an alternative way for building queries in JPA
Manual
69

Chapter 4 - JPA Queries (JPQL / Criteria)

(named) queries. It explains how to use the relevant interfaces, annotations, enums and methods ... The JPA Query Language (JPQL) can be considered as an object oriented version of SQL. Users ... well as how to use the JPA Criteria API, which provides an alternative way for building queries in JPA
Manual
69

Strings in JPQL and Criteria Queries

String values may appear in JPQL queries in various forms: as string literals - e.g. 'abc', ''. as ... literal). For example: c.name LIKE '_r%' is TRUE for 'Brazil' and FALSE for 'Denmark' c.name LIKE '%' is always TRUE (for any c.name value). c.name NOT LIKE '%' is always FALSE (for any c.name value
JPA Doc
66

JPA Annotations for JPQL Queries

The following annotations are used to define static named JPA queries: The JPA Named Queries section of the ObjectDB Manual explains and demonstrates how to use these annotations to define named JPQL queries.
Manual
49

SELECT clause (JPQL / Criteria API)

, the following query returns country names as String instances, rather than Country objects: SELECT c.name FROM Country AS c Using path expressions, such as c.name, in query results is referred to as ... > query = em.createQuery( "SELECT c.name FROM Country AS c", String.class); List
JPA Doc
44

getParameter(name, type)

Method javax.persistence.Query Parameter getParameter(   String name,   Class type ) Get the parameter object corresponding to the declared parameter of the given name and type. This method is required to be supported for criteria queries only. Parameters: name - parameter name type - type
Manual
43

FROM clause (JPQL / Criteria API)

, and the same query can also be written as follows: SELECT c FROM Country c By default, the name of an entity class in a JPQL query is the unqualified name of the class (e.g. just Country with no package ... name annotation element. Multiple range variables are allowed. For example, the following query
JPA Doc
43

setParameter(name, value)

Method javax.persistence.Query Query setParameter(   String name,   Object value ) Bind an argument to a named parameter. Parameters: name - parameter name value - parameter value Returns: the same query instance Throws: IllegalArgumentException - if the parameter name does not correspond
JPA Doc
43

setParameter(name, value, temporalType)

Method javax.persistence.Query Query setParameter(   String name,   Date value,   TemporalType ... name value - parameter value temporalType - temporal type Returns: the same query instance Throws: IllegalArgumentException - if the parameter name does not correspond to a parameter of the query or if the value argument is of incorrect type Since: JPA 1.0
JPA Doc
43

setParameter(name, value, temporalType)

Method javax.persistence.Query Query setParameter(   String name,   Calendar value,   TemporalType ... - parameter name value - parameter value temporalType - temporal type Returns: the same query instance Throws: IllegalArgumentException - if the parameter name does not correspond to a parameter of the query