|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.mguennewig.pobjects.Predicate
public class Predicate
A boolean expression to be used in the WHERE part of a
SQL statement.
CheckConstraint,
Query| Field Summary | |
|---|---|
static int |
EQUALS
The == operator. |
static int |
GREATER
The > operator. |
static int |
GREATER_EQUALS
The >= operator. |
static int |
IN
The IN operator. |
static int |
IS_NOT_NULL
The IS NOT NULL operator. |
static int |
IS_NULL
The IS NULL operator. |
static int |
LESS
The < operator. |
static int |
LESS_EQUALS
The <= operator. |
static int |
LIKE
The LIKE operator. |
static int |
NOT
The NOT operator. |
static int |
NOT_EQUALS
The ! |
| Fields inherited from interface de.mguennewig.pobjects.Condition |
|---|
AND, OR |
| Constructor Summary | |
|---|---|
Predicate(Term left,
int op,
Term right)
Creates a new Predicate. |
|
| Method Summary | |
|---|---|
static Predicate |
and(Term left,
Term right)
An AND expression of 2 Term's. |
static Predicate |
between(Term left,
Term lowerValue,
Term upperValue)
|
boolean |
equals(java.lang.Object obj)
Tests whether this boolean expression is equal to another object. |
static Predicate |
equals(Term left,
Term right)
Creates an `EQUALS' test for two terms. |
Term |
getLeftTerm()
Returns the term on the left side/before of the operand or null if it does not exist. |
int |
getOperand()
Returns the operand. |
java.lang.String |
getOperandName()
Returns a textual representation of the operand. |
Term |
getRightTerm()
Returns the term on the right side/after of the operand or null if it does not exist. |
java.lang.String |
getSqlValue(EvalContext eval)
Returns the SQL equivalent expression for this predicate. |
static Predicate |
greater(Term left,
Term right)
|
static Predicate |
greaterEqual(Term left,
Term right)
|
int |
hashCode()
|
static Predicate |
in(Term left,
LiteralSet set)
|
boolean |
isConstant()
Tests whether this expression returns a fixed value. |
boolean |
isJoin()
Tests whether this expression enforces any kind of join. |
static Predicate |
isNotNull(Term term)
Creates an `IS NOT NULL' test. |
static Predicate |
isNull(Term term)
Creates an `IS NULL' tests. |
boolean |
isOuterJoin()
Tests whether this expression enforces an outer join. |
boolean |
isSelection()
Tests whether this expression is a selection. |
java.util.Iterator<Term> |
iterator()
|
static Predicate |
less(Term left,
Term right)
|
static Predicate |
lessEqual(Term left,
Term right)
|
static Predicate |
like(Term left,
java.lang.String pattern)
|
static Predicate |
like(Term left,
Term right)
|
static Predicate |
not(Term term)
Negates the given term. |
static Predicate |
notEquals(Term left,
Term right)
Creates a `NOT EQUALS' test for two terms. |
static Predicate |
or(Term left,
Term right)
An OR expression of 2 Term's. |
static java.lang.String |
quoteForLike(java.lang.String pattern)
Quotes special SQL characters in the string for the LIKE
operator. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int EQUALS
== operator.
public static final int NOT_EQUALS
!= operator.
public static final int LESS
< operator.
public static final int LESS_EQUALS
<= operator.
public static final int GREATER
> operator.
public static final int GREATER_EQUALS
>= operator.
public static final int LIKE
LIKE operator.
public static final int IN
IN operator.
public static final int NOT
NOT operator.
public static final int IS_NULL
IS NULL operator.
public static final int IS_NOT_NULL
IS NOT NULL operator.
| Constructor Detail |
|---|
public Predicate(Term left,
int op,
Term right)
java.lang.IllegalArgumentException - if both terms are null.| Method Detail |
|---|
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objecttrue if the other object is an existing boolean
expression of the same kind with equal sub-terms.public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getSqlValue(EvalContext eval)
getSqlValue in interface Termpublic final boolean isConstant()
If true then the value of this expression can be computed
without a database and object instance.
isConstant in interface TermLiteral,
LiteralSetpublic final boolean isJoin()
isJoin in interface TermisOuterJoin()public final boolean isSelection()
With selection is an expression meant that binds a Member to
one Literal.
isSelection in interface Termpublic final int getOperand()
getOperand in interface Conditionpublic java.util.Iterator<Term> iterator()
iterator in interface java.lang.Iterable<Term>public final Term getLeftTerm()
null if it does not exist.
public final java.lang.String getOperandName()
public final Term getRightTerm()
null if it does not exist.
public final boolean isOuterJoin()
isJoin()public static java.lang.String quoteForLike(java.lang.String pattern)
LIKE
operator.
public static Predicate equals(Term left,
Term right)
public static Predicate notEquals(Term left,
Term right)
public static Predicate between(Term left,
Term lowerValue,
Term upperValue)
public static Predicate less(Term left,
Term right)
public static Predicate lessEqual(Term left,
Term right)
public static Predicate greater(Term left,
Term right)
public static Predicate greaterEqual(Term left,
Term right)
public static Predicate like(Term left,
java.lang.String pattern)
public static Predicate like(Term left,
Term right)
public static Predicate in(Term left,
LiteralSet set)
public static Predicate and(Term left,
Term right)
AND expression of 2 Term's.
left - the left side of the AND expression.right - the right side of the AND expression.
java.lang.IllegalArgumentException - if any of the term's is a
LiteralSet or null.
public static Predicate or(Term left,
Term right)
OR expression of 2 Term's.
left - the left side of the OR expression.right - the right side of the OR expression.
java.lang.IllegalArgumentException - if any of the term's is a
LiteralSet or null.public static Predicate not(Term term)
java.lang.IllegalArgumentException - if term is a LiteralSet.public static Predicate isNull(Term term)
java.lang.IllegalArgumentException - if the term is null.public static Predicate isNotNull(Term term)
java.lang.IllegalArgumentException - if the term is null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||