public class Comparison extends Object implements Condition
Condition comparing two Expressions.
Results in a rendered condition: <left> <comparator> <right> (e.g. col = 'predicate'.| Modifier and Type | Method and Description |
|---|---|
static Comparison |
create(Expression leftColumnOrExpression,
String comparator,
Expression rightColumnOrExpression)
|
static Comparison |
create(String unqualifiedColumnName,
String comparator,
Object rightValue)
Creates a new
Comparison from simple StringP arguments |
boolean |
equals(Object obj)
|
String |
getComparator() |
Expression |
getLeft() |
Expression |
getRight() |
int |
hashCode()
Generate a hash code from this
Segment. |
Condition |
not()
|
String |
toString()
Return a SQL string representation of this
Segment. |
void |
visit(Visitor visitor)
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static Comparison create(Expression leftColumnOrExpression, String comparator, Expression rightColumnOrExpression)
leftColumnOrExpression - the left Expression.comparator - the comparator.rightColumnOrExpression - the right Expression.Comparison condition.public static Comparison create(String unqualifiedColumnName, String comparator, Object rightValue)
Comparison from simple StringP argumentsunqualifiedColumnName - gets turned in a Expressions.just(String) and is expected to be an unqualified
unique column name but also could be an verbatim expression. Must not be null.comparator - must not be null.rightValue - is considered a Literal. Must not be null.public Expression getLeft()
Expression.public String getComparator()
public Expression getRight()
Expression.public String toString()
SegmentSegment.
The representation is intended for debugging purposes and an approximation to the generated SQL. While it might
work in the context of a specific dialect, you should not assume that the Segment.toString() representation works across
multiple databases.public int hashCode()
SegmentSegment.
Hashcode typically derives from the Segment.toString() representation so two Segments yield the same
Segment.hashCode() if their Segment.toString() representation matches.public boolean equals(Object obj)
SegmentSegment is equal to another Segment.
Equality is typically given if the Segment.toString() representation matches.Copyright © 2017–2022 Pivotal Software, Inc.. All rights reserved.