|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.persistence.criteria.SelectionImpl<X> org.apache.openjpa.persistence.criteria.ExpressionImpl<Boolean> org.apache.openjpa.persistence.criteria.PredicateImpl
abstract class PredicateImpl
Predicate is a expression that evaluates to true or false. All boolean expressions are implemented as Predicate. A predicate can have zero or more predicate arguments. Default predicate operator is AND (conjunction). Two constant predicates are Predicate.TRUE and Predicate.FALSE. AND predicate with no argument evaluates to TRUE. OR predicate with no argument evaluates to FALSE. Negation of a Predicate creates a new Predicate.
Nested Class Summary | |
---|---|
(package private) static class |
PredicateImpl.And
Concrete AND predicate. |
(package private) static class |
PredicateImpl.Or
Concrete OR predicate. |
Nested classes/interfaces inherited from interface javax.persistence.criteria.Predicate |
---|
Predicate.BooleanOperator |
Field Summary | |
---|---|
protected List<Predicate> |
_exps
|
static Predicate |
FALSE
|
static Predicate |
TRUE
|
Constructor Summary | |
---|---|
protected |
PredicateImpl()
An AND predicate with no arguments. |
protected |
PredicateImpl(Predicate.BooleanOperator op)
A predicate with the given operator. |
protected |
PredicateImpl(Predicate.BooleanOperator op,
Predicate... restrictions)
A predicate of given operator with given arguments. |
Method Summary | |
---|---|
void |
acceptVisit(CriteriaExpressionVisitor visitor)
Accept visit from the given visitor. |
PredicateImpl |
add(Expression<Boolean> s)
Adds the given predicate expression. |
StringBuilder |
asValue(AliasContext q)
Get a string representation of this node as a value in the context of the given query. |
List<Expression<Boolean>> |
getExpressions()
|
Predicate.BooleanOperator |
getOperator()
|
boolean |
isEmpty()
|
boolean |
isNegated()
Is this predicate created by negating another predicate? |
protected PredicateImpl |
markNegated()
|
PredicateImpl |
not()
Returns a new predicate as the negation of this predicate. |
(package private) Expression |
toKernelExpression(ExpressionFactory factory,
CriteriaQueryImpl<?> q)
Bridge contract to convert this facade expression to a kernel expression. |
(package private) Value |
toValue(ExpressionFactory factory,
CriteriaQueryImpl<?> q)
Bridge contract to convert this facade expression to a kernel value. |
Methods inherited from class org.apache.openjpa.persistence.criteria.ExpressionImpl |
---|
as, in, in, in, in, isNotNull, isNull |
Methods inherited from class org.apache.openjpa.persistence.criteria.SelectionImpl |
---|
alias, asProjection, assertValidName, asVariable, getAlias, getCompoundSelectionItems, getJavaType, isAliased, isAutoAliased, isCompoundSelection, setAutoAlias |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.persistence.criteria.Expression |
---|
as, in, in, in, in, isNotNull, isNull |
Methods inherited from interface javax.persistence.criteria.Selection |
---|
alias, getCompoundSelectionItems, isCompoundSelection |
Methods inherited from interface javax.persistence.TupleElement |
---|
getAlias, getJavaType |
Field Detail |
---|
public static final Predicate TRUE
public static final Predicate FALSE
protected final List<Predicate> _exps
Constructor Detail |
---|
protected PredicateImpl()
protected PredicateImpl(Predicate.BooleanOperator op)
protected PredicateImpl(Predicate.BooleanOperator op, Predicate... restrictions)
Method Detail |
---|
public PredicateImpl add(Expression<Boolean> s)
public List<Expression<Boolean>> getExpressions()
getExpressions
in interface Predicate
public final Predicate.BooleanOperator getOperator()
getOperator
in interface Predicate
public final boolean isEmpty()
public final boolean isNegated()
isNegated
in interface Predicate
public PredicateImpl not()
not
in interface Predicate
protected PredicateImpl markNegated()
Value toValue(ExpressionFactory factory, CriteriaQueryImpl<?> q)
ExpressionImpl
toValue
in class ExpressionImpl<Boolean>
factory
- creates the kernel expressionq
- the query definition context of this expression
Expression toKernelExpression(ExpressionFactory factory, CriteriaQueryImpl<?> q)
ExpressionImpl
toKernelExpression
in class ExpressionImpl<Boolean>
factory
- creates the kernel expressionq
- the query definition context of this expression
public void acceptVisit(CriteriaExpressionVisitor visitor)
CriteriaExpression
acceptVisit
in interface CriteriaExpression
acceptVisit
in class SelectionImpl<Boolean>
visitor
- a processor to walk the nodes of a tree.public StringBuilder asValue(AliasContext q)
CriteriaExpression
asValue
in interface CriteriaExpression
asValue
in class SelectionImpl<Boolean>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |