Search in sources :

Example 1 with BooleanStaticAssertionPredicate

use of org.hibernate.query.criteria.internal.predicate.BooleanStaticAssertionPredicate in project hibernate-orm by hibernate.

the class CriteriaBuilderImpl method isFalse.

@Override
public Predicate isFalse(Expression<Boolean> expression) {
    if (CompoundPredicate.class.isInstance(expression)) {
        final CompoundPredicate predicate = (CompoundPredicate) expression;
        if (predicate.getExpressions().size() == 0) {
            return new BooleanStaticAssertionPredicate(this, predicate.getOperator() == Predicate.BooleanOperator.OR);
        }
        predicate.not();
        return predicate;
    } else if (Predicate.class.isInstance(expression)) {
        final Predicate predicate = (Predicate) expression;
        predicate.not();
        return predicate;
    }
    return new BooleanAssertionPredicate(this, expression, Boolean.FALSE);
}
Also used : BooleanAssertionPredicate(org.hibernate.query.criteria.internal.predicate.BooleanAssertionPredicate) CompoundPredicate(org.hibernate.query.criteria.internal.predicate.CompoundPredicate) BooleanStaticAssertionPredicate(org.hibernate.query.criteria.internal.predicate.BooleanStaticAssertionPredicate) BetweenPredicate(org.hibernate.query.criteria.internal.predicate.BetweenPredicate) ComparisonPredicate(org.hibernate.query.criteria.internal.predicate.ComparisonPredicate) BooleanAssertionPredicate(org.hibernate.query.criteria.internal.predicate.BooleanAssertionPredicate) MemberOfPredicate(org.hibernate.query.criteria.internal.predicate.MemberOfPredicate) Predicate(javax.persistence.criteria.Predicate) LikePredicate(org.hibernate.query.criteria.internal.predicate.LikePredicate) CompoundPredicate(org.hibernate.query.criteria.internal.predicate.CompoundPredicate) InPredicate(org.hibernate.query.criteria.internal.predicate.InPredicate) BooleanExpressionPredicate(org.hibernate.query.criteria.internal.predicate.BooleanExpressionPredicate) NullnessPredicate(org.hibernate.query.criteria.internal.predicate.NullnessPredicate) IsEmptyPredicate(org.hibernate.query.criteria.internal.predicate.IsEmptyPredicate) ExistsPredicate(org.hibernate.query.criteria.internal.predicate.ExistsPredicate) BooleanStaticAssertionPredicate(org.hibernate.query.criteria.internal.predicate.BooleanStaticAssertionPredicate)

Aggregations

Predicate (javax.persistence.criteria.Predicate)1 BetweenPredicate (org.hibernate.query.criteria.internal.predicate.BetweenPredicate)1 BooleanAssertionPredicate (org.hibernate.query.criteria.internal.predicate.BooleanAssertionPredicate)1 BooleanExpressionPredicate (org.hibernate.query.criteria.internal.predicate.BooleanExpressionPredicate)1 BooleanStaticAssertionPredicate (org.hibernate.query.criteria.internal.predicate.BooleanStaticAssertionPredicate)1 ComparisonPredicate (org.hibernate.query.criteria.internal.predicate.ComparisonPredicate)1 CompoundPredicate (org.hibernate.query.criteria.internal.predicate.CompoundPredicate)1 ExistsPredicate (org.hibernate.query.criteria.internal.predicate.ExistsPredicate)1 InPredicate (org.hibernate.query.criteria.internal.predicate.InPredicate)1 IsEmptyPredicate (org.hibernate.query.criteria.internal.predicate.IsEmptyPredicate)1 LikePredicate (org.hibernate.query.criteria.internal.predicate.LikePredicate)1 MemberOfPredicate (org.hibernate.query.criteria.internal.predicate.MemberOfPredicate)1 NullnessPredicate (org.hibernate.query.criteria.internal.predicate.NullnessPredicate)1