org.apache.openjpa.persistence.criteria
Class CriteriaBuilderImpl

java.lang.Object
  extended by org.apache.openjpa.persistence.criteria.CriteriaBuilderImpl
All Implemented Interfaces:
Serializable, CriteriaBuilder, ExpressionParser, OpenJPACriteriaBuilder

public class CriteriaBuilderImpl
extends Object
implements OpenJPACriteriaBuilder, ExpressionParser

Factory for Criteria query expressions. Acts as an adapter to OpenJPA ExpressionFactory.

Since:
2.0.0
Author:
Pinaki Poddar, Fay Wang
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.persistence.criteria.CriteriaBuilder
CriteriaBuilder.Case<R>, CriteriaBuilder.Coalesce<T>, CriteriaBuilder.In<T>, CriteriaBuilder.SimpleCase<C,R>, CriteriaBuilder.Trimspec
 
Field Summary
 
Fields inherited from interface org.apache.openjpa.persistence.criteria.OpenJPACriteriaBuilder
LANG_CRITERIA
 
Constructor Summary
CriteriaBuilderImpl()
           
 
Method Summary
<N extends Number>
Expression<N>
abs(Expression<N> x)
           
<Y> Expression<Y>
all(Subquery<Y> subquery)
           
 Predicate and(Expression<Boolean> x, Expression<Boolean> y)
           
 Predicate and(Predicate... restrictions)
           
<Y> Expression<Y>
any(Subquery<Y> subquery)
           
 CompoundSelection<Object[]> array(Selection<?>... terms)
           
 Order asc(Expression<?> x)
           
<N extends Number>
Expression<Double>
avg(Expression<N> x)
           
<Y extends Comparable<? super Y>>
Predicate
between(Expression<? extends Y> v, Expression<? extends Y> x, Expression<? extends Y> y)
           
<Y extends Comparable<? super Y>>
Predicate
between(Expression<? extends Y> v, Y x, Y y)
           
<T> CriteriaBuilder.Coalesce<T>
coalesce()
           
<Y> Expression<Y>
coalesce(Expression<? extends Y> x, Expression<? extends Y> y)
           
<Y> Expression<Y>
coalesce(Expression<? extends Y> x, Y y)
           
 Expression<String> concat(Expression<String> x, Expression<String> y)
           
 Expression<String> concat(Expression<String> x, String y)
           
 Expression<String> concat(String x, Expression<String> y)
           
 Predicate conjunction()
           
<Y> CompoundSelection<Y>
construct(Class<Y> result, Selection<?>... selections)
          Define a select list item corresponding to a constructor.
 Expression<Long> count(Expression<?> x)
           
 Expression<Long> countDistinct(Expression<?> x)
           
 OpenJPACriteriaQuery<Object> createQuery()
          Create a CriteriaQuery object.
<T> OpenJPACriteriaQuery<T>
createQuery(Class<T> resultClass)
          Create a Criteria query object with the specified result type.
 OpenJPACriteriaQuery<Tuple> createTupleQuery()
          Create a Criteria query object that returns a tuple of objects as its result.
 Expression<Date> currentDate()
           
 Expression<Time> currentTime()
           
 Expression<Timestamp> currentTimestamp()
           
 Order desc(Expression<?> x)
           
<N extends Number>
Expression<N>
diff(Expression<? extends N> x, Expression<? extends N> y)
           
<N extends Number>
Expression<N>
diff(Expression<? extends N> x, N y)
           
<N extends Number>
Expression<N>
diff(N x, Expression<? extends N> y)
           
 Predicate disjunction()
           
 Predicate equal(Expression<?> x, Expression<?> y)
           
 Predicate equal(Expression<?> x, Object y)
           
 QueryExpressions eval(Object parsed, ExpressionStoreQuery query, ExpressionFactory factory, ClassMetaData candidate)
          Parse the given query string.
 Value[] eval(String[] vals, ExpressionStoreQuery query, ExpressionFactory factory, ClassMetaData candidate)
          Parse the given value clauses.
 Predicate exists(Subquery<?> subquery)
           
<T> Expression<T>
function(String name, Class<T> type, Expression<?>... args)
           
 Predicate ge(Expression<? extends Number> x, Expression<? extends Number> y)
           
 Predicate ge(Expression<? extends Number> x, Number y)
           
 String getLanguage()
          Return a string key describing the language that this instance parses.
 Metamodel getMetamodel()
          Gets the metamodel for the managed, persistent domain entities.
<Y extends Comparable<? super Y>>
Predicate
greaterThan(Expression<? extends Y> x, Expression<? extends Y> y)
           
<Y extends Comparable<? super Y>>
Predicate
greaterThan(Expression<? extends Y> x, Y y)
           
<Y extends Comparable<? super Y>>
Predicate
greaterThanOrEqualTo(Expression<? extends Y> x, Expression<? extends Y> y)
           
<Y extends Comparable<? super Y>>
Predicate
greaterThanOrEqualTo(Expression<? extends Y> x, Y y)
           
<X extends Comparable<? super X>>
Expression<X>
greatest(Expression<X> x)
           
 Predicate gt(Expression<? extends Number> x, Expression<? extends Number> y)
           
 Predicate gt(Expression<? extends Number> x, Number y)
           
<T> CriteriaBuilder.In<T>
in(Expression<? extends T> expression)
           
<C extends Collection<?>>
Predicate
isEmpty(Expression<C> collection)
           
 Predicate isFalse(Expression<Boolean> x)
           
<E,C extends Collection<E>>
Predicate
isMember(E e, Expression<C> c)
           
<E,C extends Collection<E>>
Predicate
isMember(Expression<E> e, Expression<C> c)
           
<C extends Collection<?>>
Predicate
isNotEmpty(Expression<C> collection)
           
<E,C extends Collection<E>>
Predicate
isNotMember(E e, Expression<C> c)
           
<E,C extends Collection<E>>
Predicate
isNotMember(Expression<E> e, Expression<C> c)
           
 Predicate isNotNull(Expression<?> x)
           
 Predicate isNull(Expression<?> x)
           
 Predicate isTrue(Expression<Boolean> x)
           
<K,M extends Map<K,?>>
Expression<Set<K>>
keys(M map)
           
 Predicate le(Expression<? extends Number> x, Expression<? extends Number> y)
           
 Predicate le(Expression<? extends Number> x, Number y)
           
<X extends Comparable<? super X>>
Expression<X>
least(Expression<X> x)
           
 Expression<Integer> length(Expression<String> x)
           
<Y extends Comparable<? super Y>>
Predicate
lessThan(Expression<? extends Y> x, Expression<? extends Y> y)
           
<Y extends Comparable<? super Y>>
Predicate
lessThan(Expression<? extends Y> x, Y y)
           
<Y extends Comparable<? super Y>>
Predicate
lessThanOrEqualTo(Expression<? extends Y> x, Expression<? extends Y> y)
           
<Y extends Comparable<? super Y>>
Predicate
lessThanOrEqualTo(Expression<? extends Y> x, Y y)
           
 Predicate like(Expression<String> x, Expression<String> pattern)
           
 Predicate like(Expression<String> x, Expression<String> pattern, char escapeChar)
           
 Predicate like(Expression<String> x, Expression<String> pattern, Expression<Character> escapeChar)
           
 Predicate like(Expression<String> x, String pattern)
           
 Predicate like(Expression<String> x, String pattern, char escapeChar)
           
 Predicate like(Expression<String> x, String pattern, Expression<Character> escapeChar)
           
<T> Expression<T>
literal(T value)
           
 Expression<Integer> locate(Expression<String> x, Expression<String> pattern)
           
 Expression<Integer> locate(Expression<String> x, Expression<String> pattern, Expression<Integer> from)
           
 Expression<Integer> locate(Expression<String> x, String pattern)
           
 Expression<Integer> locate(Expression<String> x, String pattern, int from)
           
 Expression<String> lower(Expression<String> x)
           
 Predicate lt(Expression<? extends Number> x, Expression<? extends Number> y)
           
 Predicate lt(Expression<? extends Number> x, Number y)
           
<N extends Number>
Expression<N>
max(Expression<N> x)
           
<N extends Number>
Expression<N>
min(Expression<N> x)
           
 Expression<Integer> mod(Expression<Integer> x, Expression<Integer> y)
           
 Expression<Integer> mod(Expression<Integer> x, Integer y)
           
 Expression<Integer> mod(Integer x, Expression<Integer> y)
           
<N extends Number>
Expression<N>
neg(Expression<N> x)
           
 Predicate not(Expression<Boolean> restriction)
           
 Predicate notEqual(Expression<?> x, Expression<?> y)
           
 Predicate notEqual(Expression<?> x, Object y)
           
 Predicate notLike(Expression<String> x, Expression<String> pattern)
           
 Predicate notLike(Expression<String> x, Expression<String> pattern, char escapeChar)
           
 Predicate notLike(Expression<String> x, Expression<String> pattern, Expression<Character> escapeChar)
           
 Predicate notLike(Expression<String> x, String pattern)
           
 Predicate notLike(Expression<String> x, String pattern, char escapeChar)
           
 Predicate notLike(Expression<String> x, String pattern, Expression<Character> escapeChar)
           
<Y> Expression<Y>
nullif(Expression<Y> x, Expression<?> y)
           
<Y> Expression<Y>
nullif(Expression<Y> x, Y y)
           
<T> Expression<T>
nullLiteral(Class<T> t)
           
 Predicate or(Expression<Boolean> x, Expression<Boolean> y)
           
 Predicate or(Predicate... restrictions)
           
<T> ParameterExpression<T>
parameter(Class<T> paramClass)
          Construct a ParameterExpression with a null name as key.
<T> ParameterExpression<T>
parameter(Class<T> paramClass, String name)
           
 Object parse(String ql, ExpressionStoreQuery query)
          Return a parsed intermediate form of the given query string.
 void populate(Object parsed, ExpressionStoreQuery query)
          Use the parsed query form to set information such as candidate type, result type, etc that was encoded in the query string.
<N extends Number>
Expression<N>
prod(Expression<? extends N> x, Expression<? extends N> y)
           
<N extends Number>
Expression<N>
prod(Expression<? extends N> x, N y)
           
<N extends Number>
Expression<N>
prod(N x, Expression<? extends N> y)
           
<T> Predicate
qbe(From<?,T> from, T example)
          Overloaded with default comparison style and no extra attribute to exclude.
<T> Predicate
qbe(From<?,T> from, T example, Attribute<?,?>... excludes)
          Overloaded with default comparison style.
<T> Predicate
qbe(From<?,T> from, T example, ComparisonStyle style)
          Overloaded with no extra attribute to exclude.
<T> Predicate
qbe(From<?,T> from, T example, ComparisonStyle style, Attribute<?,?>... excludes)
          Create a predicate based upon the attribute values of a given "example" entity instance.
 ComparisonStyle qbeStyle()
          Create a style to tune different aspects of comparison by example.
 Expression<Number> quot(Expression<? extends Number> x, Expression<? extends Number> y)
           
 Expression<Number> quot(Expression<? extends Number> x, Number y)
           
 Expression<Number> quot(Number x, Expression<? extends Number> y)
           
<R> CriteriaBuilder.Case<R>
selectCase()
           
<C,R> CriteriaBuilder.SimpleCase<C,R>
selectCase(Expression<? extends C> expression)
           
 OpenJPACriteriaBuilder setMetaModel(MetamodelImpl model)
           
<C extends Collection<?>>
Expression<Integer>
size(C collection)
           
<C extends Collection<?>>
Expression<Integer>
size(Expression<C> collection)
           
<Y> Expression<Y>
some(Subquery<Y> subquery)
           
 Expression<Double> sqrt(Expression<? extends Number> x)
           
 Expression<String> substring(Expression<String> x, Expression<Integer> from)
           
 Expression<String> substring(Expression<String> x, Expression<Integer> from, Expression<Integer> len)
           
 Expression<String> substring(Expression<String> x, int from)
           
 Expression<String> substring(Expression<String> x, int from, int len)
           
<N extends Number>
Expression<N>
sum(Expression<? extends N> x, Expression<? extends N> y)
           
<N extends Number>
Expression<N>
sum(Expression<? extends N> x, N y)
           
<N extends Number>
Expression<N>
sum(Expression<N> x)
           
<N extends Number>
Expression<N>
sum(N x, Expression<? extends N> y)
           
 Expression<Double> sumAsDouble(Expression<Float> x)
           
 Expression<Long> sumAsLong(Expression<Integer> x)
           
 Expression<BigDecimal> toBigDecimal(Expression<? extends Number> number)
           
 Expression<BigInteger> toBigInteger(Expression<? extends Number> number)
           
 Expression<Double> toDouble(Expression<? extends Number> number)
           
 Expression<Float> toFloat(Expression<? extends Number> number)
           
 Expression<Integer> toInteger(Expression<? extends Number> number)
           
 Expression<Long> toLong(Expression<? extends Number> number)
           
 Expression<String> toString(Expression<Character> character)
           
 Expression<String> trim(char t, Expression<String> x)
           
 Expression<String> trim(CriteriaBuilder.Trimspec ts, char t, Expression<String> x)
           
 Expression<String> trim(CriteriaBuilder.Trimspec ts, Expression<Character> t, Expression<String> x)
           
 Expression<String> trim(CriteriaBuilder.Trimspec ts, Expression<String> x)
           
 Expression<String> trim(Expression<Character> t, Expression<String> x)
           
 Expression<String> trim(Expression<String> x)
           
 CompoundSelection<Tuple> tuple(Selection<?>... selections)
          Define a tuple-valued selection item
 Expression<String> upper(Expression<String> x)
           
<V,M extends Map<?,V>>
Expression<Collection<V>>
values(M map)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CriteriaBuilderImpl

public CriteriaBuilderImpl()
Method Detail

setMetaModel

public OpenJPACriteriaBuilder setMetaModel(MetamodelImpl model)

getMetamodel

public Metamodel getMetamodel()
Description copied from interface: OpenJPACriteriaBuilder
Gets the metamodel for the managed, persistent domain entities.

Specified by:
getMetamodel in interface OpenJPACriteriaBuilder

eval

public QueryExpressions eval(Object parsed,
                             ExpressionStoreQuery query,
                             ExpressionFactory factory,
                             ClassMetaData candidate)
Description copied from interface: ExpressionParser
Parse the given query string.

Specified by:
eval in interface ExpressionParser

eval

public Value[] eval(String[] vals,
                    ExpressionStoreQuery query,
                    ExpressionFactory factory,
                    ClassMetaData candidate)
Description copied from interface: ExpressionParser
Parse the given value clauses.

Specified by:
eval in interface ExpressionParser

getLanguage

public String getLanguage()
Description copied from interface: ExpressionParser
Return a string key describing the language that this instance parses.

Specified by:
getLanguage in interface ExpressionParser

createQuery

public <T> OpenJPACriteriaQuery<T> createQuery(Class<T> resultClass)
Create a Criteria query object with the specified result type.

Specified by:
createQuery in interface CriteriaBuilder
Specified by:
createQuery in interface OpenJPACriteriaBuilder
Parameters:
resultClass - type of the query result
Returns:
query object

createTupleQuery

public OpenJPACriteriaQuery<Tuple> createTupleQuery()
Create a Criteria query object that returns a tuple of objects as its result.

Specified by:
createTupleQuery in interface CriteriaBuilder
Specified by:
createTupleQuery in interface OpenJPACriteriaBuilder
Returns:
query object

parse

public Object parse(String ql,
                    ExpressionStoreQuery query)
Description copied from interface: ExpressionParser
Return a parsed intermediate form of the given query string.

Specified by:
parse in interface ExpressionParser

populate

public void populate(Object parsed,
                     ExpressionStoreQuery query)
Description copied from interface: ExpressionParser
Use the parsed query form to set information such as candidate type, result type, etc that was encoded in the query string.

Specified by:
populate in interface ExpressionParser

abs

public <N extends Number> Expression<N> abs(Expression<N> x)
Specified by:
abs in interface CriteriaBuilder

all

public <Y> Expression<Y> all(Subquery<Y> subquery)
Specified by:
all in interface CriteriaBuilder

and

public Predicate and(Predicate... restrictions)
Specified by:
and in interface CriteriaBuilder

and

public Predicate and(Expression<Boolean> x,
                     Expression<Boolean> y)
Specified by:
and in interface CriteriaBuilder

any

public <Y> Expression<Y> any(Subquery<Y> subquery)
Specified by:
any in interface CriteriaBuilder

asc

public Order asc(Expression<?> x)
Specified by:
asc in interface CriteriaBuilder

avg

public <N extends Number> Expression<Double> avg(Expression<N> x)
Specified by:
avg in interface CriteriaBuilder

between

public <Y extends Comparable<? super Y>> Predicate between(Expression<? extends Y> v,
                                                           Expression<? extends Y> x,
                                                           Expression<? extends Y> y)
Specified by:
between in interface CriteriaBuilder

between

public <Y extends Comparable<? super Y>> Predicate between(Expression<? extends Y> v,
                                                           Y x,
                                                           Y y)
Specified by:
between in interface CriteriaBuilder

coalesce

public <T> CriteriaBuilder.Coalesce<T> coalesce()
Specified by:
coalesce in interface CriteriaBuilder

coalesce

public <Y> Expression<Y> coalesce(Expression<? extends Y> x,
                                  Expression<? extends Y> y)
Specified by:
coalesce in interface CriteriaBuilder

coalesce

public <Y> Expression<Y> coalesce(Expression<? extends Y> x,
                                  Y y)
Specified by:
coalesce in interface CriteriaBuilder

concat

public Expression<String> concat(Expression<String> x,
                                 Expression<String> y)
Specified by:
concat in interface CriteriaBuilder

concat

public Expression<String> concat(Expression<String> x,
                                 String y)
Specified by:
concat in interface CriteriaBuilder

concat

public Expression<String> concat(String x,
                                 Expression<String> y)
Specified by:
concat in interface CriteriaBuilder

conjunction

public Predicate conjunction()
Specified by:
conjunction in interface CriteriaBuilder

count

public Expression<Long> count(Expression<?> x)
Specified by:
count in interface CriteriaBuilder

countDistinct

public Expression<Long> countDistinct(Expression<?> x)
Specified by:
countDistinct in interface CriteriaBuilder

createQuery

public OpenJPACriteriaQuery<Object> createQuery()
Description copied from interface: OpenJPACriteriaBuilder
Create a CriteriaQuery object.

Specified by:
createQuery in interface CriteriaBuilder
Specified by:
createQuery in interface OpenJPACriteriaBuilder
Returns:
criteria query object

currentDate

public Expression<Date> currentDate()
Specified by:
currentDate in interface CriteriaBuilder

currentTime

public Expression<Time> currentTime()
Specified by:
currentTime in interface CriteriaBuilder

currentTimestamp

public Expression<Timestamp> currentTimestamp()
Specified by:
currentTimestamp in interface CriteriaBuilder

desc

public Order desc(Expression<?> x)
Specified by:
desc in interface CriteriaBuilder

diff

public <N extends Number> Expression<N> diff(Expression<? extends N> x,
                                             Expression<? extends N> y)
Specified by:
diff in interface CriteriaBuilder

diff

public <N extends Number> Expression<N> diff(Expression<? extends N> x,
                                             N y)
Specified by:
diff in interface CriteriaBuilder

diff

public <N extends Number> Expression<N> diff(N x,
                                             Expression<? extends N> y)
Specified by:
diff in interface CriteriaBuilder

disjunction

public Predicate disjunction()
Specified by:
disjunction in interface CriteriaBuilder

equal

public Predicate equal(Expression<?> x,
                       Expression<?> y)
Specified by:
equal in interface CriteriaBuilder

equal

public Predicate equal(Expression<?> x,
                       Object y)
Specified by:
equal in interface CriteriaBuilder

exists

public Predicate exists(Subquery<?> subquery)
Specified by:
exists in interface CriteriaBuilder

function

public <T> Expression<T> function(String name,
                                  Class<T> type,
                                  Expression<?>... args)
Specified by:
function in interface CriteriaBuilder

ge

public Predicate ge(Expression<? extends Number> x,
                    Expression<? extends Number> y)
Specified by:
ge in interface CriteriaBuilder

ge

public Predicate ge(Expression<? extends Number> x,
                    Number y)
Specified by:
ge in interface CriteriaBuilder

greaterThan

public <Y extends Comparable<? super Y>> Predicate greaterThan(Expression<? extends Y> x,
                                                               Expression<? extends Y> y)
Specified by:
greaterThan in interface CriteriaBuilder

greaterThan

public <Y extends Comparable<? super Y>> Predicate greaterThan(Expression<? extends Y> x,
                                                               Y y)
Specified by:
greaterThan in interface CriteriaBuilder

greaterThanOrEqualTo

public <Y extends Comparable<? super Y>> Predicate greaterThanOrEqualTo(Expression<? extends Y> x,
                                                                        Expression<? extends Y> y)
Specified by:
greaterThanOrEqualTo in interface CriteriaBuilder

greaterThanOrEqualTo

public <Y extends Comparable<? super Y>> Predicate greaterThanOrEqualTo(Expression<? extends Y> x,
                                                                        Y y)
Specified by:
greaterThanOrEqualTo in interface CriteriaBuilder

greatest

public <X extends Comparable<? super X>> Expression<X> greatest(Expression<X> x)
Specified by:
greatest in interface CriteriaBuilder

gt

public Predicate gt(Expression<? extends Number> x,
                    Expression<? extends Number> y)
Specified by:
gt in interface CriteriaBuilder

gt

public Predicate gt(Expression<? extends Number> x,
                    Number y)
Specified by:
gt in interface CriteriaBuilder

in

public <T> CriteriaBuilder.In<T> in(Expression<? extends T> expression)
Specified by:
in in interface CriteriaBuilder

isEmpty

public <C extends Collection<?>> Predicate isEmpty(Expression<C> collection)
Specified by:
isEmpty in interface CriteriaBuilder

isFalse

public Predicate isFalse(Expression<Boolean> x)
Specified by:
isFalse in interface CriteriaBuilder

isMember

public <E,C extends Collection<E>> Predicate isMember(E e,
                                                      Expression<C> c)
Specified by:
isMember in interface CriteriaBuilder

isMember

public <E,C extends Collection<E>> Predicate isMember(Expression<E> e,
                                                      Expression<C> c)
Specified by:
isMember in interface CriteriaBuilder

isNotEmpty

public <C extends Collection<?>> Predicate isNotEmpty(Expression<C> collection)
Specified by:
isNotEmpty in interface CriteriaBuilder

isNotMember

public <E,C extends Collection<E>> Predicate isNotMember(E e,
                                                         Expression<C> c)
Specified by:
isNotMember in interface CriteriaBuilder

isNotMember

public <E,C extends Collection<E>> Predicate isNotMember(Expression<E> e,
                                                         Expression<C> c)
Specified by:
isNotMember in interface CriteriaBuilder

isTrue

public Predicate isTrue(Expression<Boolean> x)
Specified by:
isTrue in interface CriteriaBuilder

keys

public <K,M extends Map<K,?>> Expression<Set<K>> keys(M map)
Specified by:
keys in interface CriteriaBuilder

le

public Predicate le(Expression<? extends Number> x,
                    Expression<? extends Number> y)
Specified by:
le in interface CriteriaBuilder

le

public Predicate le(Expression<? extends Number> x,
                    Number y)
Specified by:
le in interface CriteriaBuilder

least

public <X extends Comparable<? super X>> Expression<X> least(Expression<X> x)
Specified by:
least in interface CriteriaBuilder

length

public Expression<Integer> length(Expression<String> x)
Specified by:
length in interface CriteriaBuilder

lessThan

public <Y extends Comparable<? super Y>> Predicate lessThan(Expression<? extends Y> x,
                                                            Expression<? extends Y> y)
Specified by:
lessThan in interface CriteriaBuilder

lessThan

public <Y extends Comparable<? super Y>> Predicate lessThan(Expression<? extends Y> x,
                                                            Y y)
Specified by:
lessThan in interface CriteriaBuilder

lessThanOrEqualTo

public <Y extends Comparable<? super Y>> Predicate lessThanOrEqualTo(Expression<? extends Y> x,
                                                                     Expression<? extends Y> y)
Specified by:
lessThanOrEqualTo in interface CriteriaBuilder

lessThanOrEqualTo

public <Y extends Comparable<? super Y>> Predicate lessThanOrEqualTo(Expression<? extends Y> x,
                                                                     Y y)
Specified by:
lessThanOrEqualTo in interface CriteriaBuilder

like

public Predicate like(Expression<String> x,
                      Expression<String> pattern)
Specified by:
like in interface CriteriaBuilder

like

public Predicate like(Expression<String> x,
                      String pattern)
Specified by:
like in interface CriteriaBuilder

like

public Predicate like(Expression<String> x,
                      Expression<String> pattern,
                      Expression<Character> escapeChar)
Specified by:
like in interface CriteriaBuilder

like

public Predicate like(Expression<String> x,
                      Expression<String> pattern,
                      char escapeChar)
Specified by:
like in interface CriteriaBuilder

like

public Predicate like(Expression<String> x,
                      String pattern,
                      Expression<Character> escapeChar)
Specified by:
like in interface CriteriaBuilder

like

public Predicate like(Expression<String> x,
                      String pattern,
                      char escapeChar)
Specified by:
like in interface CriteriaBuilder

literal

public <T> Expression<T> literal(T value)
Specified by:
literal in interface CriteriaBuilder

locate

public Expression<Integer> locate(Expression<String> x,
                                  Expression<String> pattern)
Specified by:
locate in interface CriteriaBuilder

locate

public Expression<Integer> locate(Expression<String> x,
                                  String pattern)
Specified by:
locate in interface CriteriaBuilder

locate

public Expression<Integer> locate(Expression<String> x,
                                  Expression<String> pattern,
                                  Expression<Integer> from)
Specified by:
locate in interface CriteriaBuilder

locate

public Expression<Integer> locate(Expression<String> x,
                                  String pattern,
                                  int from)
Specified by:
locate in interface CriteriaBuilder

lower

public Expression<String> lower(Expression<String> x)
Specified by:
lower in interface CriteriaBuilder

lt

public Predicate lt(Expression<? extends Number> x,
                    Expression<? extends Number> y)
Specified by:
lt in interface CriteriaBuilder

lt

public Predicate lt(Expression<? extends Number> x,
                    Number y)
Specified by:
lt in interface CriteriaBuilder

max

public <N extends Number> Expression<N> max(Expression<N> x)
Specified by:
max in interface CriteriaBuilder

min

public <N extends Number> Expression<N> min(Expression<N> x)
Specified by:
min in interface CriteriaBuilder

mod

public Expression<Integer> mod(Expression<Integer> x,
                               Expression<Integer> y)
Specified by:
mod in interface CriteriaBuilder

mod

public Expression<Integer> mod(Expression<Integer> x,
                               Integer y)
Specified by:
mod in interface CriteriaBuilder

mod

public Expression<Integer> mod(Integer x,
                               Expression<Integer> y)
Specified by:
mod in interface CriteriaBuilder

neg

public <N extends Number> Expression<N> neg(Expression<N> x)
Specified by:
neg in interface CriteriaBuilder

not

public Predicate not(Expression<Boolean> restriction)
Specified by:
not in interface CriteriaBuilder

notEqual

public Predicate notEqual(Expression<?> x,
                          Expression<?> y)
Specified by:
notEqual in interface CriteriaBuilder

notEqual

public Predicate notEqual(Expression<?> x,
                          Object y)
Specified by:
notEqual in interface CriteriaBuilder

notLike

public Predicate notLike(Expression<String> x,
                         Expression<String> pattern)
Specified by:
notLike in interface CriteriaBuilder

notLike

public Predicate notLike(Expression<String> x,
                         String pattern)
Specified by:
notLike in interface CriteriaBuilder

notLike

public Predicate notLike(Expression<String> x,
                         Expression<String> pattern,
                         Expression<Character> escapeChar)
Specified by:
notLike in interface CriteriaBuilder

notLike

public Predicate notLike(Expression<String> x,
                         Expression<String> pattern,
                         char escapeChar)
Specified by:
notLike in interface CriteriaBuilder

notLike

public Predicate notLike(Expression<String> x,
                         String pattern,
                         Expression<Character> escapeChar)
Specified by:
notLike in interface CriteriaBuilder

notLike

public Predicate notLike(Expression<String> x,
                         String pattern,
                         char escapeChar)
Specified by:
notLike in interface CriteriaBuilder

nullif

public <Y> Expression<Y> nullif(Expression<Y> x,
                                Expression<?> y)
Specified by:
nullif in interface CriteriaBuilder

nullif

public <Y> Expression<Y> nullif(Expression<Y> x,
                                Y y)
Specified by:
nullif in interface CriteriaBuilder

or

public Predicate or(Predicate... restrictions)
Specified by:
or in interface CriteriaBuilder

or

public Predicate or(Expression<Boolean> x,
                    Expression<Boolean> y)
Specified by:
or in interface CriteriaBuilder

parameter

public <T> ParameterExpression<T> parameter(Class<T> paramClass)
Construct a ParameterExpression with a null name as key. The name of this parameter will be assigned automatically when this parameter expression is registered in a Criteriaquery during tree traversal.

Specified by:
parameter in interface CriteriaBuilder
See Also:
ParameterExpressionImpl#assignAutoName(String)

parameter

public <T> ParameterExpression<T> parameter(Class<T> paramClass,
                                            String name)
Specified by:
parameter in interface CriteriaBuilder

prod

public <N extends Number> Expression<N> prod(Expression<? extends N> x,
                                             Expression<? extends N> y)
Specified by:
prod in interface CriteriaBuilder

prod

public <N extends Number> Expression<N> prod(Expression<? extends N> x,
                                             N y)
Specified by:
prod in interface CriteriaBuilder

prod

public <N extends Number> Expression<N> prod(N x,
                                             Expression<? extends N> y)
Specified by:
prod in interface CriteriaBuilder

quot

public Expression<Number> quot(Expression<? extends Number> x,
                               Expression<? extends Number> y)
Specified by:
quot in interface CriteriaBuilder

quot

public Expression<Number> quot(Expression<? extends Number> x,
                               Number y)
Specified by:
quot in interface CriteriaBuilder

quot

public Expression<Number> quot(Number x,
                               Expression<? extends Number> y)
Specified by:
quot in interface CriteriaBuilder

construct

public <Y> CompoundSelection<Y> construct(Class<Y> result,
                                          Selection<?>... selections)
Define a select list item corresponding to a constructor.

Specified by:
construct in interface CriteriaBuilder
Parameters:
result - class whose instance is to be constructed
selections - arguments to the constructor
Returns:
selection item

selectCase

public <R> CriteriaBuilder.Case<R> selectCase()
Specified by:
selectCase in interface CriteriaBuilder

selectCase

public <C,R> CriteriaBuilder.SimpleCase<C,R> selectCase(Expression<? extends C> expression)
Specified by:
selectCase in interface CriteriaBuilder

size

public <C extends Collection<?>> Expression<Integer> size(C collection)
Specified by:
size in interface CriteriaBuilder

size

public <C extends Collection<?>> Expression<Integer> size(Expression<C> collection)
Specified by:
size in interface CriteriaBuilder

some

public <Y> Expression<Y> some(Subquery<Y> subquery)
Specified by:
some in interface CriteriaBuilder

sqrt

public Expression<Double> sqrt(Expression<? extends Number> x)
Specified by:
sqrt in interface CriteriaBuilder

substring

public Expression<String> substring(Expression<String> x,
                                    Expression<Integer> from)
Specified by:
substring in interface CriteriaBuilder

substring

public Expression<String> substring(Expression<String> x,
                                    int from)
Specified by:
substring in interface CriteriaBuilder

substring

public Expression<String> substring(Expression<String> x,
                                    Expression<Integer> from,
                                    Expression<Integer> len)
Specified by:
substring in interface CriteriaBuilder

substring

public Expression<String> substring(Expression<String> x,
                                    int from,
                                    int len)
Specified by:
substring in interface CriteriaBuilder

sum

public <N extends Number> Expression<N> sum(Expression<N> x)
Specified by:
sum in interface CriteriaBuilder

sum

public <N extends Number> Expression<N> sum(Expression<? extends N> x,
                                            Expression<? extends N> y)
Specified by:
sum in interface CriteriaBuilder

sum

public <N extends Number> Expression<N> sum(Expression<? extends N> x,
                                            N y)
Specified by:
sum in interface CriteriaBuilder

sum

public <N extends Number> Expression<N> sum(N x,
                                            Expression<? extends N> y)
Specified by:
sum in interface CriteriaBuilder

sumAsLong

public Expression<Long> sumAsLong(Expression<Integer> x)
Specified by:
sumAsLong in interface CriteriaBuilder

sumAsDouble

public Expression<Double> sumAsDouble(Expression<Float> x)
Specified by:
sumAsDouble in interface CriteriaBuilder

toBigDecimal

public Expression<BigDecimal> toBigDecimal(Expression<? extends Number> number)
Specified by:
toBigDecimal in interface CriteriaBuilder

toBigInteger

public Expression<BigInteger> toBigInteger(Expression<? extends Number> number)
Specified by:
toBigInteger in interface CriteriaBuilder

toDouble

public Expression<Double> toDouble(Expression<? extends Number> number)
Specified by:
toDouble in interface CriteriaBuilder

toFloat

public Expression<Float> toFloat(Expression<? extends Number> number)
Specified by:
toFloat in interface CriteriaBuilder

toInteger

public Expression<Integer> toInteger(Expression<? extends Number> number)
Specified by:
toInteger in interface CriteriaBuilder

toLong

public Expression<Long> toLong(Expression<? extends Number> number)
Specified by:
toLong in interface CriteriaBuilder

toString

public Expression<String> toString(Expression<Character> character)
Specified by:
toString in interface CriteriaBuilder

trim

public Expression<String> trim(Expression<String> x)
Specified by:
trim in interface CriteriaBuilder

trim

public Expression<String> trim(CriteriaBuilder.Trimspec ts,
                               Expression<String> x)
Specified by:
trim in interface CriteriaBuilder

trim

public Expression<String> trim(Expression<Character> t,
                               Expression<String> x)
Specified by:
trim in interface CriteriaBuilder

trim

public Expression<String> trim(char t,
                               Expression<String> x)
Specified by:
trim in interface CriteriaBuilder

trim

public Expression<String> trim(CriteriaBuilder.Trimspec ts,
                               Expression<Character> t,
                               Expression<String> x)
Specified by:
trim in interface CriteriaBuilder

trim

public Expression<String> trim(CriteriaBuilder.Trimspec ts,
                               char t,
                               Expression<String> x)
Specified by:
trim in interface CriteriaBuilder

upper

public Expression<String> upper(Expression<String> x)
Specified by:
upper in interface CriteriaBuilder

values

public <V,M extends Map<?,V>> Expression<Collection<V>> values(M map)
Specified by:
values in interface CriteriaBuilder

array

public CompoundSelection<Object[]> array(Selection<?>... terms)
Specified by:
array in interface CriteriaBuilder

isNotNull

public Predicate isNotNull(Expression<?> x)
Specified by:
isNotNull in interface CriteriaBuilder

isNull

public Predicate isNull(Expression<?> x)
Specified by:
isNull in interface CriteriaBuilder

nullLiteral

public <T> Expression<T> nullLiteral(Class<T> t)
Specified by:
nullLiteral in interface CriteriaBuilder

tuple

public CompoundSelection<Tuple> tuple(Selection<?>... selections)
Define a tuple-valued selection item

Specified by:
tuple in interface CriteriaBuilder
Parameters:
selections - selection items
Returns:
tuple-valued compound selection
Throws:
IllegalArgumentException - if an argument is a tuple- or array-valued selection item

qbe

public <T> Predicate qbe(From<?,T> from,
                         T example,
                         ComparisonStyle style,
                         Attribute<?,?>... excludes)
Create a predicate based upon the attribute values of a given "example" entity instance. The predicate is the conjunction or disjunction of predicates for subset of attribute of the entity.
By default, all the singular entity attributes (the basic, embedded and uni-cardinality relations) that have a non-null or non-default value for the example instance and are not an identity or version attribute are included. The comparable attributes can be further pruned by specifying variable list of attributes as the final argument.

Specified by:
qbe in interface OpenJPACriteriaBuilder
Parameters:
example - an instance of an entity class
style - specifies various aspects of comparison such as whether non-null attribute values be included, how string-valued attribute be compared, whether the individual attribute based predicates are ANDed or ORed etc.
excludes - list of attributes that are excluded from comparison.
Returns:
a predicate

qbe

public <T> Predicate qbe(From<?,T> from,
                         T example,
                         ComparisonStyle style)
Description copied from interface: OpenJPACriteriaBuilder
Overloaded with no extra attribute to exclude.

Specified by:
qbe in interface OpenJPACriteriaBuilder

qbe

public <T> Predicate qbe(From<?,T> from,
                         T example,
                         Attribute<?,?>... excludes)
Description copied from interface: OpenJPACriteriaBuilder
Overloaded with default comparison style.

Specified by:
qbe in interface OpenJPACriteriaBuilder

qbe

public <T> Predicate qbe(From<?,T> from,
                         T example)
Description copied from interface: OpenJPACriteriaBuilder
Overloaded with default comparison style and no extra attribute to exclude.

Specified by:
qbe in interface OpenJPACriteriaBuilder

qbeStyle

public ComparisonStyle qbeStyle()
Create a style to tune different aspects of comparison by example.

Specified by:
qbeStyle in interface OpenJPACriteriaBuilder


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.