org.hibernate.query.criteria.internal.predicate.AbstractPredicateImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core Show documentation
Show all versions of hibernate-core Show documentation
Hibernate's core ORM functionality
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or .
*/
package org.hibernate.query.criteria.internal.predicate;
import java.io.Serializable;
import java.util.List;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Selection;
import org.hibernate.query.criteria.internal.CriteriaBuilderImpl;
import org.hibernate.query.criteria.internal.expression.ExpressionImpl;
/**
* Basic template support for {@link Predicate} implementors providing
* expression handling, negation and conjunction/disjunction handling.
*
* @author Steve Ebersole
*/
public abstract class AbstractPredicateImpl
extends ExpressionImpl
implements PredicateImplementor, Serializable {
protected AbstractPredicateImpl(CriteriaBuilderImpl criteriaBuilder) {
super( criteriaBuilder, Boolean.class );
}
public boolean isNegated() {
return false;
}
public Predicate not() {
return new NegatedPredicateWrapper( this );
}
// Selection ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@Override
public final boolean isCompoundSelection() {
// Should always be false for predicates
return super.isCompoundSelection();
}
@Override
public final List> getCompoundSelectionItems() {
// Should never have sub selection items for predicates
return super.getCompoundSelectionItems();
}
}