Home » Search

About named queries

11-20 of 200Refresh
Manual
88

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
71

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
67

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
Manual
61

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
Manual
51

JPA Persistable Types

, package or private) and it can be either concrete or abstract. Entity Class Names Entity classes are represented in queries by entity names. By default, the entity name is the unqualified name of the entity class (i.e. the short class name excluding the package name). A different entity name can be set
Manual
47

ORDER BY clause (JPQL / Criteria API)

Expressions The following query returns names of countries whose population size ... . The following query returns Country objects ordered by currency as the primary sort key and by name as ... The ORDER BY clause in the above query orders the results by the currency name. Without an ORDER BY clause
Manual
46

GROUP BY and HAVING clauses

(which does not use aggregates) is equivalent to the following query: SELECT DISTINCT SUBSTRING(c.name, 1 ... SUBSTRING(c.name, 1, 1); The query returns Object[] arrays of length 3, in which the first cell ... The GROUP BY clause enables grouping of query results. A JPQL query with a GROUP BY clause returns
JPA Doc
46

JPA Queries

Queries are represented in JPA by the Query and TypedQuery interfaces: The JPA Query API section ... these interfaces to build and run JPQL queries. The TypedQuery interface (or alternatively the older Query interface) is the only neccessary interface for defining and running string based JPQL queries (e.g
Manual
45

DELETE Queries in JPA/JPQL

. Applying changes to the database by calling the commit method. JPQL DELETE queries provide an alternative way for deleting entity objects. Unlike SELECT queries, which are used to retrieve data from the database, DELETE queries do not retrieve data from the database, but when executed, delete specified
JPA Doc
45

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