About expression

api-jpa

currentTime()

Create expression to return current time.(Method of javax.persistence.criteria.CriteriaBuilder)

 
api-jpa

currentTimestamp()

Create expression to return current timestamp.(Method of javax.persistence.criteria.CriteriaBuilder)

 
api-jpa

isNotNull(x)

Create a predicate to test whether the expression is not null.(Method of javax.persistence.criteria.CriteriaBuilder)

 
api-jpa

in(values)

Create a predicate to test whether the expression is a member of the collection.(Method of javax.persistence.criteria.Expression)

 
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: ... the created criteria in debugger we get the correct expression: SELECT DISTINCT $1 FROM MyEntity $1 WHERE ... Caused by: com.objectdb.o.UserException: Invalid order expression '$2' for distinct results at ... ; import javax. persistence . criteria . Expression ; import javax. persistence . criteria . Join ...

 
api-jpa

as(type)

Perform a typecast upon the expression, returning a new expression object.(Method of javax.persistence.criteria.Expression)

 
api-jpa

nullif(x, y)

Create an expression that tests whether its argument are equal, returning null if they are and the value of the first expression if they are not.(Method of javax.persistence.criteria.CriteriaBuilder)

 
api-jpa

orderBy(o)

Specify the ordering expressions that are used to order the query results.(Method of javax.persistence.criteria.CriteriaQuery)

 
api-jpa

nullif(x, y)

Create an expression that tests whether its argument are equal, returning null if they are and the value of the first expression if they are not.(Method of javax.persistence.criteria.CriteriaBuilder)

 
manual

[ODB1] Chapter 7 - JDOQL Queries

Explains how to use JDOQL, the Java/JDO Query Language.... class) A filter, which is a boolean expression in a Java like syntax The query result is a subset of ... Only instances for which the evaluation of the filter expression is true are included in the result collection. If an index is ...