org.apache.openjpa.persistence.query
Class UnaryExpressionPredicate

java.lang.Object
  extended by org.apache.openjpa.persistence.query.AbstractVisitable
      extended by org.apache.openjpa.persistence.query.UnaryExpressionPredicate
All Implemented Interfaces:
Serializable, Predicate, Visitable
Direct Known Subclasses:
ExistsExpression, IsEmptyExpression, IsNullExpression

 class UnaryExpressionPredicate
extends AbstractVisitable
implements Predicate, Visitable

Unary Predicate results from an operator on an Expression.

Author:
Pinaki Poddar

Field Summary
protected  Expression _e
           
protected  UnaryConditionalOperator _op
           
 
Fields inherited from class org.apache.openjpa.persistence.query.AbstractVisitable
CLOSE_BRACE, COMMA, EMPTY, OPEN_BRACE, SPACE
 
Constructor Summary
UnaryExpressionPredicate(Expression e, UnaryConditionalOperator op, UnaryConditionalOperator nop)
           
 
Method Summary
 Predicate and(Predicate predicate)
          Creates an AND of the predicate with the argument.
 String asExpression(AliasContext ctx)
          Get a JPQL fragment as used in WHERE clause.
 Expression getOperand()
           
 UnaryConditionalOperator getOperator()
           
 Predicate not()
          Creates a negation of the predicate with the argument.
 Predicate or(Predicate predicate)
          Creates an OR of the predicate with the argument.
 
Methods inherited from class org.apache.openjpa.persistence.query.AbstractVisitable
asJoinable, asProjection, getAliasHint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.openjpa.persistence.query.Visitable
asJoinable, asProjection, getAliasHint
 

Field Detail

_e

protected final Expression _e

_op

protected final UnaryConditionalOperator _op
Constructor Detail

UnaryExpressionPredicate

public UnaryExpressionPredicate(Expression e,
                                UnaryConditionalOperator op,
                                UnaryConditionalOperator nop)
Method Detail

getOperand

public Expression getOperand()

getOperator

public UnaryConditionalOperator getOperator()

and

public Predicate and(Predicate predicate)
Description copied from interface: Predicate
Creates an AND of the predicate with the argument.

Specified by:
and in interface Predicate
Parameters:
predicate - - A simple or compound predicate
Returns:
the predicate that is the AND of the original simple or compound predicate and the argument.

or

public Predicate or(Predicate predicate)
Description copied from interface: Predicate
Creates an OR of the predicate with the argument.

Specified by:
or in interface Predicate
Parameters:
predicate - - A simple or compound predicate
Returns:
the predicate that is the OR of the original simple or compound predicate and the argument.

not

public Predicate not()
Description copied from interface: Predicate
Creates a negation of the predicate with the argument.

Specified by:
not in interface Predicate
Returns:
the predicate that is the negation of the original simple or compound predicate.

asExpression

public String asExpression(AliasContext ctx)
Description copied from interface: Visitable
Get a JPQL fragment as used in WHERE clause.

Specified by:
asExpression in interface Visitable
Overrides:
asExpression in class AbstractVisitable


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.