Top Fields Constructors Methods
org.hibernate.query.criteria.internal.predicate

public Class NegatedPredicateWrapper

extends ExpressionImpl<Boolean>
implements PredicateImplementor, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.hibernate.query.criteria.internal.predicate.PredicateImplementor, org.hibernate.query.criteria.internal.Renderable, javax.persistence.criteria.Predicate, javax.persistence.criteria.Expression, javax.persistence.criteria.Selection, javax.persistence.TupleElement
Imports
java.io.Serializable, java.util.ArrayList, .Collections, .List, javax.persistence.criteria.Expression, .Predicate, org.hibernate.query.criteria.internal.CriteriaBuilderImpl, .ParameterContainer, .ParameterRegistry, org.hibernate.query.criteria.internal.compile.RenderingContext, org.hibernate.query.criteria.internal.expression.ExpressionImpl

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final List<Expression<Boolean>>
private final Predicate.BooleanOperator
private final PredicateImplementor

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public List<Expression<Boolean>>
getExpressions()

Implements javax.persistence.criteria.Predicate.getExpressions.

Return the top-level conjuncts or disjuncts of the predicate.
public Predicate.BooleanOperator
getOperator()

Implements javax.persistence.criteria.Predicate.getOperator.

Return the boolean operator for the predicate.
public boolean
public boolean
isNegated()

Implements javax.persistence.criteria.Predicate.isNegated.

Whether the predicate has been created from another predicate by applying the Predicate.not() method or the CriteriaBuilder.not() method.
private static List<Expression<Boolean>>
public Predicate
not()

Implements javax.persistence.criteria.Predicate.not.

Create a negation of the predicate.
public void
registerParameters(ParameterRegistry
The parameter registry with which to register.
registry
)

Implements org.hibernate.query.criteria.internal.ParameterContainer.registerParameters.

Register any parameters contained within this query component with the given registry.
public String
render(boolean
Should the predicate be negated.
isNegated
,
RenderingContext
The context for rendering
renderingContext
)

Implements org.hibernate.query.criteria.internal.predicate.PredicateImplementor.render.

Form of Renderable#render used when the predicate is wrapped in a negated wrapper.
public String
render(RenderingContext renderingContext)

Implements org.hibernate.query.criteria.internal.Renderable.render.

Perform the rendering, returning the rendition
Inherited from org.hibernate.query.criteria.internal.expression.ExpressionImpl:
asasBigDecimalasBigIntegerasDoubleasFloatasIntegerasLongasStringininininisNotNullisNull

Field Detail

negatedExpressionsback to summary
private final List<Expression<Boolean>> negatedExpressions
negatedOperatorback to summary
private final Predicate.BooleanOperator negatedOperator
predicateback to summary
private final PredicateImplementor predicate

Constructor Detail

NegatedPredicateWrapperback to summary
public NegatedPredicateWrapper(PredicateImplementor predicate)
Annotations
@SuppressWarnings:unchecked

Method Detail

getExpressionsback to summary
public List<Expression<Boolean>> getExpressions()

Implements javax.persistence.criteria.Predicate.getExpressions.

Doc from javax.persistence.criteria.Predicate.getExpressions.

Return the top-level conjuncts or disjuncts of the predicate. Returns empty list if there are no top-level conjuncts or disjuncts of the predicate. Modifications to the list do not affect the query.

Returns:List<Expression<Boolean>>

list of boolean expressions forming the predicate

Annotations
@Override
getOperatorback to summary
public Predicate.BooleanOperator getOperator()

Implements javax.persistence.criteria.Predicate.getOperator.

Doc from javax.persistence.criteria.Predicate.getOperator.

Return the boolean operator for the predicate. If the predicate is simple, this is AND.

Returns:Predicate.BooleanOperator

boolean operator for the predicate

Annotations
@Override
isJunctionback to summary
public boolean isJunction()

Implements org.hibernate.query.criteria.internal.predicate.PredicateImplementor.isJunction.

Doc from org.hibernate.query.criteria.internal.predicate.PredicateImplementor.isJunction.

Is this a conjunction or disjunction?

Returns:boolean

true if this predicate is a junction (AND/OR); false otherwise

Annotations
@Override
isNegatedback to summary
public boolean isNegated()

Implements javax.persistence.criteria.Predicate.isNegated.

Doc from javax.persistence.criteria.Predicate.isNegated.

Whether the predicate has been created from another predicate by applying the Predicate.not() method or the CriteriaBuilder.not() method.

Returns:boolean

boolean indicating if the predicate is a negated predicate

Annotations
@Override
negateCompoundExpressionsback to summary
private static List<Expression<Boolean>> negateCompoundExpressions(List<Expression<Boolean>> expressions, CriteriaBuilderImpl criteriaBuilder)
notback to summary
public Predicate not()

Implements javax.persistence.criteria.Predicate.not.

Doc from javax.persistence.criteria.Predicate.not.

Create a negation of the predicate.

Returns:Predicate

negated predicate

Annotations
@Override
registerParametersback to summary
public void registerParameters(ParameterRegistry registry)

Implements org.hibernate.query.criteria.internal.ParameterContainer.registerParameters.

Doc from org.hibernate.query.criteria.internal.ParameterContainer.registerParameters.

Register any parameters contained within this query component with the given registry.

Parameters
registry:ParameterRegistry

The parameter registry with which to register.

Annotations
@Override
renderback to summary
public String render(boolean isNegated, RenderingContext renderingContext)

Implements org.hibernate.query.criteria.internal.predicate.PredicateImplementor.render.

Doc from org.hibernate.query.criteria.internal.predicate.PredicateImplementor.render.

Form of Renderable#render used when the predicate is wrapped in a negated wrapper. Allows passing down the negation flag.

Note that this form is no-op in compound (junction) predicates. The reason being that compound predicates are more complex and the negation is applied during its creation.

Parameters
isNegated:boolean

Should the predicate be negated.

renderingContext:RenderingContext

The context for rendering

Returns:String

The rendered predicate fragment.

Annotations
@Override
renderback to summary
public String render(RenderingContext renderingContext)

Implements org.hibernate.query.criteria.internal.Renderable.render.

Doc from org.hibernate.query.criteria.internal.Renderable.render.

Perform the rendering, returning the rendition

Annotations
@Override