Interface OpenJPACriteriaBuilder
- All Superinterfaces:
CriteriaBuilder
- All Known Implementing Classes:
CriteriaBuilderImpl
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 CriteriaBuilder
CriteriaBuilder.Case<R>, CriteriaBuilder.Coalesce<T>, CriteriaBuilder.In<T>, CriteriaBuilder.SimpleCase<C,R>, CriteriaBuilder.Trimspec -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe mnemonic to identify the query language. -
Method Summary
Modifier and TypeMethodDescriptionCreate aCriteriaQueryobject.<T> OpenJPACriteriaQuery<T> createQuery(Class<T> resultClass) Create aCriteriaQueryobject with the specified result type.Create aCriteriaQueryobject that returns a tuple of objects as its result.Gets the metamodel for the managed, persistent domain entities.<T> PredicateOverloaded with default comparison style and no extra attribute to exclude.<T> PredicateOverloaded with default comparison style.<T> Predicateqbe(From<?, T> from, T example, ComparisonStyle style) Overloaded with no extra attribute to exclude.<T> Predicateqbe(From<?, T> from, T example, ComparisonStyle style, Attribute<?, ?>... excludes) Create a predicate based upon the attribute values of a given "example" entity instance.qbeStyle()Create a mutable style to apply on query-by-example.Methods inherited from interface CriteriaBuilder
abs, all, and, and, and, any, array, array, asc, asc, avg, between, between, ceiling, coalesce, coalesce, coalesce, concat, concat, concat, concat, conjunction, construct, count, countDistinct, createCriteriaDelete, createCriteriaUpdate, currentDate, currentTime, currentTimestamp, desc, desc, diff, diff, diff, disjunction, equal, equal, except, exceptAll, exists, exp, extract, floor, function, ge, ge, greaterThan, greaterThan, greaterThanOrEqualTo, greaterThanOrEqualTo, greatest, gt, gt, in, intersect, intersectAll, isEmpty, isFalse, isMember, isMember, isNotEmpty, isNotMember, isNotMember, isNotNull, isNull, isTrue, keys, le, le, least, left, left, length, lessThan, lessThan, lessThanOrEqualTo, lessThanOrEqualTo, like, like, like, like, like, like, literal, ln, localDate, localDateTime, localTime, 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, or, parameter, parameter, power, power, prod, prod, prod, quot, quot, quot, replace, replace, replace, replace, right, right, round, selectCase, selectCase, sign, size, size, some, sqrt, substring, substring, substring, substring, sum, sum, sum, sum, sumAsDouble, sumAsLong, toBigDecimal, toBigInteger, toDouble, toFloat, toInteger, toLong, toString, treat, treat, treat, treat, treat, treat, treat, trim, trim, trim, trim, trim, trim, tuple, tuple, union, unionAll, upper, values
-
Field Details
-
LANG_CRITERIA
-
-
Method Details
-
qbe
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
Overloaded with no extra attribute to exclude. -
qbe
-
qbe
-
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 aCriteriaQueryobject.- Specified by:
createQueryin interfaceCriteriaBuilder- Returns:
- criteria query object
-
createQuery
Create aCriteriaQueryobject with the specified result type.- Specified by:
createQueryin interfaceCriteriaBuilder- Parameters:
resultClass- type of the query result- Returns:
- criteria query object
-
createTupleQuery
OpenJPACriteriaQuery<Tuple> createTupleQuery()Create aCriteriaQueryobject that returns a tuple of objects as its result.- Specified by:
createTupleQueryin interfaceCriteriaBuilder- Returns:
- criteria query object
-