Top Description Methods
org.hibernate.query.criteria

public Interface HibernateCriteriaBuilder

extends CriteriaBuilder
Known Direct Implementers
org.hibernate.query.criteria.internal.CriteriaBuilderImpl
Imports
java.util.Map, javax.persistence.criteria.CriteriaBuilder, .Expression, .Order, .Predicate

Hibernate extensions to the JPA CriteriaBuilder. Currently there are no extensions; these are coming in 6.0
Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public Order

Returns:

ascending ordering corresponding to the expression
asc
(Expression<?>
expression used to define the ordering
x
,
boolean
Whether null should be sorted first
nullsFirst
)

Create an ordering by the ascending value of the expression.

public Order

Returns:

descending ordering corresponding to the expression
desc
(Expression<?>
expression used to define the ordering
x
,
boolean
Whether null should be sorted first
nullsFirst
)

Create an ordering by the descending value of the expression.

public <M extends Map<?, ?>> Predicate

Returns:

is-empty predicate
isMapEmpty
(Expression<M>
The expression resolving to a Map which we want to check for emptiness
mapExpression
)

Create a predicate that tests whether a Map is empty.

public <M extends Map<?, ?>> Predicate

Returns:

is-not-empty predicate
isMapNotEmpty
(Expression<M>
The expression resolving to a Map which we want to check for non-emptiness
mapExpression
)

Create a predicate that tests whether a Map is not empty.

public <M extends Map<?, ?>> Expression<Integer>

Returns:

size expression
mapSize
(Expression<M>
The expression resolving to a Map for which we want to know the size
mapExpression
)

Create an expression that tests the size of a map.

public <M extends Map<?, ?>> Expression<Integer>

Returns:

size expression
mapSize
(M
The Map for which we want to know the size
map
)

Create an expression that tests the size of a map.

Inherited from javax.persistence.criteria.CriteriaBuilder:
absallandandanyarrayascavgbetweenbetweencoalescecoalescecoalesceconcatconcatconcatconjunctionconstructcountcountDistinctcreateCriteriaDeletecreateCriteriaUpdatecreateQuerycreateQuerycreateTupleQuerycurrentDatecurrentTimecurrentTimestampdescdiffdiffdiffdisjunctionequalequalexistsfunctiongegegreaterThangreaterThangreaterThanOrEqualTogreaterThanOrEqualTogreatestgtgtinisEmptyisFalseisMemberisMemberisNotEmptyisNotMemberisNotMemberisNotNullisNullisTruekeysleleleastlengthlessThanlessThanlessThanOrEqualTolessThanOrEqualTolikelikelikelikelikelikeliterallocatelocatelocatelocatelowerltltmaxminmodmodmodnegnotnotEqualnotEqualnotLikenotLikenotLikenotLikenotLikenotLikenullifnullifnullLiteralororparameterparameterprodprodprodquotquotquotselectCaseselectCasesizesizesomesqrtsubstringsubstringsubstringsubstringsumsumsumsumsumAsDoublesumAsLongtoBigDecimaltoBigIntegertoDoubletoFloattoIntegertoLongtoStringtreattreattreattreattreattreattreattrimtrimtrimtrimtrimtrimtupleuppervalues

Method Detail

ascback to summary
public Order asc(Expression<?> x, boolean nullsFirst)

Create an ordering by the ascending value of the expression.

Parameters
x:Expression<?>

expression used to define the ordering

nullsFirst:boolean

Whether null should be sorted first

Returns:Order

ascending ordering corresponding to the expression

descback to summary
public Order desc(Expression<?> x, boolean nullsFirst)

Create an ordering by the descending value of the expression.

Parameters
x:Expression<?>

expression used to define the ordering

nullsFirst:boolean

Whether null should be sorted first

Returns:Order

descending ordering corresponding to the expression

isMapEmptyback to summary
public <M extends Map<?, ?>> Predicate isMapEmpty(Expression<M> mapExpression)

Create a predicate that tests whether a Map is empty.

NOTE : Due to type-erasure we cannot name this the same as CriteriaBuilder#isEmpty

Parameters
mapExpression:Expression<M>

The expression resolving to a Map which we want to check for emptiness

Returns:Predicate

is-empty predicate

isMapNotEmptyback to summary
public <M extends Map<?, ?>> Predicate isMapNotEmpty(Expression<M> mapExpression)

Create a predicate that tests whether a Map is not empty.

NOTE : Due to type-erasure we cannot name this the same as CriteriaBuilder#isNotEmpty

Parameters
mapExpression:Expression<M>

The expression resolving to a Map which we want to check for non-emptiness

Returns:Predicate

is-not-empty predicate

mapSizeback to summary
public <M extends Map<?, ?>> Expression<Integer> mapSize(Expression<M> mapExpression)

Create an expression that tests the size of a map.

NOTE : Due to type-erasure we cannot name this the same as CriteriaBuilder#size

Parameters
mapExpression:Expression<M>

The expression resolving to a Map for which we want to know the size

Returns:Expression<Integer>

size expression

mapSizeback to summary
public <M extends Map<?, ?>> Expression<Integer> mapSize(M map)

Create an expression that tests the size of a map.

Parameters
map:M

The Map for which we want to know the size

Returns:Expression<Integer>

size expression