Class LogicalPredicate
- java.lang.Object
-
- org.apache.openjpa.persistence.query.LogicalPredicate
-
- All Implemented Interfaces:
Serializable,Predicate,Visitable
- Direct Known Subclasses:
AndPredicate,OrPredicate
public class LogicalPredicate extends Object implements Predicate, Visitable
Logical Predicate combines two predicates with a logical operator.- Author:
- Pinaki Poddar
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringCLOSE_BRACEstatic StringCOMMAstatic StringEMPTYstatic StringOPEN_BRACEstatic StringSPACE
-
Constructor Summary
Constructors Constructor Description LogicalPredicate(Predicate p1, ConditionalOperator op, ConditionalOperator nop, Predicate p2)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Predicateand(Predicate predicate)Creates an AND of the predicate with the argument.StringasExpression(org.apache.openjpa.persistence.query.AliasContext ctx)Get a JPQL fragment as used in WHERE clause.StringasJoinable(org.apache.openjpa.persistence.query.AliasContext ctx)Gets the string representation in FROM clause.StringasProjection(org.apache.openjpa.persistence.query.AliasContext ctx)Gets the string representation in SELECT projection.StringgetAliasHint(org.apache.openjpa.persistence.query.AliasContext ctx)Gets the hint to be used while creating alias.Predicatenot()Creates a negation of the predicate with the argument.Predicateor(Predicate predicate)Creates an OR of the predicate with the argument.-
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
-
SPACE
public static final String SPACE
- See Also:
- Constant Field Values
-
OPEN_BRACE
public static final String OPEN_BRACE
- See Also:
- Constant Field Values
-
CLOSE_BRACE
public static final String CLOSE_BRACE
- See Also:
- Constant Field Values
-
COMMA
public static final String COMMA
- See Also:
- Constant Field Values
-
EMPTY
public static final String EMPTY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LogicalPredicate
public LogicalPredicate(Predicate p1, ConditionalOperator op, ConditionalOperator nop, Predicate p2)
-
-
Method Detail
-
and
public Predicate and(Predicate predicate)
Description copied from interface:PredicateCreates an AND of the predicate with the argument.
-
or
public Predicate or(Predicate predicate)
Description copied from interface:PredicateCreates an OR of the predicate with the argument.
-
not
public Predicate not()
Description copied from interface:PredicateCreates a negation of the predicate with the argument.
-
asExpression
public String asExpression(org.apache.openjpa.persistence.query.AliasContext ctx)
Description copied from interface:VisitableGet a JPQL fragment as used in WHERE clause.- Specified by:
asExpressionin interfaceVisitable
-
asProjection
public String asProjection(org.apache.openjpa.persistence.query.AliasContext ctx)
Description copied from interface:VisitableGets the string representation in SELECT projection.- Specified by:
asProjectionin interfaceVisitable
-
getAliasHint
public String getAliasHint(org.apache.openjpa.persistence.query.AliasContext ctx)
Description copied from interface:VisitableGets the hint to be used while creating alias.- Specified by:
getAliasHintin interfaceVisitable
-
asJoinable
public String asJoinable(org.apache.openjpa.persistence.query.AliasContext ctx)
Description copied from interface:VisitableGets the string representation in FROM clause.- Specified by:
asJoinablein interfaceVisitable
-
-