About Criteria API

manual

Strings in JPQL and Criteria Queries

Explains string expressions in JPQL queries, including LIKE, LOCATE, LOWER, UPPER, TRIM, CONCAT and SUBSTRING.... Java String Methods (ObjectDB Extension) Criteria Query String Expressions LIKE - String Pattern ... are more powerful than the LIKE operator). Criteria Query String Expressions JPQL string operators and functions ...

 
manual

GROUP BY and HAVING clauses

Explains how to use the GROUP BY and HAVING clauses in a JPA/JPQL query.... (no GROUP BY) GROUP BY and HAVING in Criteria Queries GROUP BY as DISTINCT (no Aggregates) ... fields become inaccessible. GROUP BY and HAVING in Criteria Queries The CriteriaQuery ... 1 can be built using the criteria query API as follows:     CriteriaQuery ...

 
manual

Query Parameters in JPA

Explains how to use parameters (named parameters and ordinal parameters) in JPA queries.... Ordinal Parameters (?index) Criteria Query Parameters Parameters vs. Literals API Parameter Methods Named Parameters (:name) ...

 
forum_thread

JPA 2.0 Criteria API: (When) Fully supported ?

An excerpt from the website of a 3rd party vendor which tries to support JPA 2.0:   "The primary difference between JPA 1.0 and JPA 2.0 implementations is how data is fetched: the JPA 1.0 implementation creates a JPQL query string for fetching while the JPA 2.0 implementation uses Criteria API.   Tested JPA 2.0 providers ... string for fetching while the JPA 2.0 implementation uses Criteria API.   Tested JPA 2.0 providers    * ...

 
api-jpa

JPA Metamodel API

Reference (JavaDoc) of the JPA Metamodel API, including all the type and attribute interfaces. The JPA Metamodel API, which is introduced in JPA 2.0, enables examining the classes, fields and ... The JPA Metamodel API may optionally be used with the JPA Criteria API. Many of the interfaces in the above sets extend the Bindable interface, which may be used in defining criteria query variables in the FROM clause: ...

 
issue

JPA Query Criteria API (JPA 2.0)

The JPA Criteria API supports dynamic definition of JPQL queries using CriteriaBuilder as a factory. ObjectDB supports dynamic definition of JPQL queries as strings and expected to support also the new JPA 2 Criteria API in future versions.  ... 11:17 The JPA Criteria API supports dynamic definition of JPQL queries using CriteriaBuilder javax.persistence.criteria.CriteriaBuilder JPA interface Used to construct criteria ...

 
issue

Strange Error with Criteria API and Sorting

We're creating a simple selection (distinct) including an order clause. When watching the created criteria in debugger we get the correct expression: SELECT DISTINCT $1 FROM MyEntity $1 WHERE ((TYPE($1)=class test.MyEntity)) ORDER BY UPPER($1.name) DESC You can see that in the order by there's correctly a "$1" var. Running this (without the type thing before) in the explorer correctly returns the sorted results. However, running this with the criteria API produces this error: ... an order clause. When watching the created criteria in debugger we get the correct expression: SELECT ... results. However, running this with the criteria API produces this error: Caused by: com.objectdb.o.UserException: Invalid ...

 
issue

Issue with TYPE expression in Criteria API

Find attached project using latest 2.3.4_03 odb still causes:   ... persistence . *; import javax. persistence . criteria . CriteriaBuilder ; import javax. persistence . criteria . CriteriaQuery ; import javax. persistence . criteria . Root ;   public class I112 { ...

 
forum_thread

IN expression in a Criteria Query

Hello, I am trying to migrate my Spring project from Hibernate to ObjectDB. On ObjectDB page, it is written that ObjectDB is 100% compatible with JPA. However, I have problem with this JPQL query: SELECT e FROM Employee e WHERE e.present = false AND NOT EXISTS (SELECT c FROM Computer c WHERE c.employeeEntity = e) ORDER BY e.name with Hibernate, there was no problem with this query, but ObjectDB throws exception: ... query token 'EXISTS' Second problem is with Criteria Language. This code: In<Employee> inExpression = cb. ... The test case you have posted uses the CriteriaBuilder API. The problem I was getting, was a syntax error when the "IN (:bindVar)" was ...

 
page

ObjectDB Object Database Features

ObjectDB provides a rich set of features, many of them as the result of supporting the JPA and JDO APIs.... of the JPA JPA Reference (JavaDoc) Java/JPA API Reference (based on the JPA 3 JavaDoc) See JavaDoc Reference Page... ... Dynamic query definition, including using JPA Criteria Query API . Static definition ( ...