org.apache.openjpa.persistence.criteria
Interface OpenJPACriteriaBuilder

All Superinterfaces:
CriteriaBuilder
All Known Implementing Classes:
CriteriaBuilderImpl

public interface OpenJPACriteriaBuilder
extends CriteriaBuilder

OpenJPA-specific extension to JPA 2.0 Criteria Query Builder API.

Since:
2.0.0
Author:
Pinaki Poddar

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
static String LANG_CRITERIA
          The mnemonic to identify the query language.
 
Method Summary
 OpenJPACriteriaQuery<Object> createQuery()
          Create a CriteriaQuery object.
<T> OpenJPACriteriaQuery<T>
createQuery(Class<T> resultClass)
          Create a CriteriaQuery object with the specified result type.
 OpenJPACriteriaQuery<Tuple> createTupleQuery()
          Create a CriteriaQuery object that returns a tuple of objects as its result.
 Metamodel getMetamodel()
          Gets the metamodel for the managed, persistent domain entities.
<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 mutable style to apply on query-by-example.
 
Methods inherited from interface javax.persistence.criteria.CriteriaBuilder
abs, all, and, and, any, array, asc, avg, between, between, coalesce, coalesce, coalesce, concat, concat, concat, conjunction, construct, count, countDistinct, currentDate, currentTime, currentTimestamp, desc, diff, diff, diff, disjunction, equal, equal, exists, function, ge, ge, greaterThan, greaterThan, greaterThanOrEqualTo, greaterThanOrEqualTo, greatest, gt, gt, in, isEmpty, isFalse, isMember, isMember, isNotEmpty, isNotMember, isNotMember, isNotNull, isNull, isTrue, keys, le, le, least, length, lessThan, lessThan, lessThanOrEqualTo, lessThanOrEqualTo, like, like, like, like, like, like, literal, locate, locate, locate, locate, lower, lt, lt, max, min, mod, mod, mod, neg, not, notEqual, notEqual, notLike, notLike, notLike, notLike, notLike, notLike, nullif, nullif, nullLiteral, or, or, parameter, parameter, prod, prod, prod, quot, quot, quot, selectCase, selectCase, size, size, some, sqrt, substring, substring, substring, substring, sum, sum, sum, sum, sumAsDouble, sumAsLong, toBigDecimal, toBigInteger, toDouble, toFloat, toInteger, toLong, toString, trim, trim, trim, trim, trim, trim, tuple, upper, values
 

Field Detail

LANG_CRITERIA

static final String LANG_CRITERIA
The mnemonic to identify the query language.

See Also:
Constant Field Values
Method Detail

qbe

<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.
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 for exclusion.

Parameters:
example - a non-null instance of a persistent entity.
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. Can be null to designate default comparison style.
excludes - list of attributes that are excluded from comparison. Can be null.
Returns:
a predicate

qbe

<T> Predicate qbe(From<?,T> from,
                  T example,
                  ComparisonStyle style)
Overloaded with no extra attribute to exclude.


qbe

<T> Predicate qbe(From<?,T> from,
                  T example,
                  Attribute<?,?>... excludes)
Overloaded with default comparison style.


qbe

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


qbeStyle

ComparisonStyle qbeStyle()
Create a mutable style to apply on query-by-example.


getMetamodel

Metamodel getMetamodel()
Gets the metamodel for the managed, persistent domain entities.


createQuery

OpenJPACriteriaQuery<Object> createQuery()
Create a CriteriaQuery object.

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

createQuery

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

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

createTupleQuery

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

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


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