Package com.alibaba.druid.sql.ast.expr
Class SQLBinaryOpExpr
java.lang.Object
com.alibaba.druid.sql.ast.SQLObjectImpl
com.alibaba.druid.sql.ast.SQLExprImpl
com.alibaba.druid.sql.ast.expr.SQLBinaryOpExpr
- All Implemented Interfaces:
SQLDbTypedObject,SQLExpr,SQLObject,SQLReplaceable,Serializable,Cloneable,Comparable<SQLBinaryOpExpr>
public class SQLBinaryOpExpr
extends SQLExprImpl
implements SQLReplaceable, Serializable, SQLDbTypedObject, Comparable<SQLBinaryOpExpr>
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DbTypeprotected SQLExprprotected SQLBinaryOperatorprotected SQLExprFields inherited from class com.alibaba.druid.sql.ast.SQLExprImpl
parenthesizedFields inherited from class com.alibaba.druid.sql.ast.SQLObjectImpl
attributes, hint, parent, sourceColumn, sourceLine -
Constructor Summary
ConstructorsConstructorDescriptionSQLBinaryOpExpr(DbType dbType) SQLBinaryOpExpr(SQLExpr left, SQLBinaryOperator operator, SQLExpr right) SQLBinaryOpExpr(SQLExpr left, SQLBinaryOperator operator, SQLExpr right, DbType dbType) SQLBinaryOpExpr(SQLExpr left, SQLExpr right, SQLBinaryOperator operator) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaccept0(SQLASTVisitor visitor) static SQLExprstatic SQLExprstatic SQLExprandIfNotExists(SQLExpr a, SQLExpr b) clone()static SQLExprcombine(List<? extends SQLExpr> items, SQLBinaryOperator op) intbooleanconditionContainsColumn(String column) booleanconditionContainsTable(String alias) static SQLBinaryOpExprconditionEq(String column, int value) static SQLBinaryOpExprconditionEq(String column, String value) static SQLBinaryOpExprconditionLike(String column, SQLExpr value) static SQLBinaryOpExprconditionLike(String column, String value) booleanstatic SQLBinaryOpExprbooleanequals(SQLBinaryOpExpr other) booleanbooleanequalsIgoreOrder(SQLBinaryOpExpr other) getLeft()Retrieves the merged list of SQLObjects.getRight()inthashCode()static booleanbooleanbooleanbooleanbooleanbooleanstatic SQLBinaryOpExprstatic SQLBinaryOpExprstatic booleanstatic SQLBinaryOpExprMerges the given SQLBinaryOpExpr with its parent using a parameterized visitor.static SQLExprstatic SQLExprbooleanvoidvoidvoidsetOperator(SQLBinaryOperator operator) voidsplit(SQLExpr x, SQLBinaryOperator op) static voidsplit(List<SQLExpr> outList, SQLExpr expr, SQLBinaryOperator op) toString()Methods inherited from class com.alibaba.druid.sql.ast.SQLExprImpl
isParenthesized, setParenthesizedMethods inherited from class com.alibaba.druid.sql.ast.SQLObjectImpl
accept, acceptChild, acceptChild, addAfterComment, addAfterComment, addBeforeComment, addBeforeComment, containsAttribute, getAfterCommentsDirect, getAttribute, getAttributes, getAttributesDirect, getBeforeCommentsDirect, getHint, getParent, getSourceColumn, getSourceLine, hasAfterComment, hasBeforeComment, output, putAttribute, setHint, setParent, setSourceColumn, setSourceLineMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.alibaba.druid.sql.ast.SQLObject
accept, addAfterComment, addAfterComment, addBeforeComment, addBeforeComment, containsAttribute, getAfterCommentsDirect, getAttribute, getAttributes, getAttributesDirect, getBeforeCommentsDirect, getParent, hasAfterComment, hasBeforeComment, output, putAttribute, setParent
-
Field Details
-
left
-
right
-
operator
-
dbType
-
mergedList
-
-
Constructor Details
-
SQLBinaryOpExpr
public SQLBinaryOpExpr() -
SQLBinaryOpExpr
-
SQLBinaryOpExpr
-
SQLBinaryOpExpr
-
SQLBinaryOpExpr
-
-
Method Details
-
getDbType
- Specified by:
getDbTypein interfaceSQLDbTypedObject
-
setDbType
-
getLeft
-
setLeft
-
getRight
-
setRight
-
getOperator
-
setOperator
-
accept0
- Specified by:
accept0in classSQLObjectImpl
-
getChildren
- Specified by:
getChildrenin interfaceSQLExpr- Overrides:
getChildrenin classSQLExprImpl
-
hashCode
public int hashCode()- Specified by:
hashCodein classSQLExprImpl
-
equals
- Specified by:
equalsin classSQLExprImpl
-
equals
-
equalsIgoreOrder
-
clone
-
toString
- Overrides:
toStringin classSQLObjectImpl
-
combine
-
split
-
split
-
split
-
split
-
and
-
and
-
or
-
or
-
andIfNotExists
-
isNotNull
-
isNull
-
replace
- Specified by:
replacein interfaceSQLReplaceable
-
other
-
contains
-
computeDataType
- Specified by:
computeDataTypein interfaceSQLExpr- Overrides:
computeDataTypein classSQLExprImpl
-
conditionContainsTable
-
conditionContainsColumn
-
merge
Merges the given SQLBinaryOpExpr with its parent using a parameterized visitor.- Parameters:
v- the parameterized visitor used for mergingx- the SQLBinaryOpExpr to be merged- Returns:
- the merged SQLBinaryOpExpr
-
getMergedList
Retrieves the merged list of SQLObjects.- Returns:
- the merged list of SQLObjects
-
isOr
-
isAnd
-
isLeftNameAndRightLiteral
public boolean isLeftNameAndRightLiteral() -
isLeftFunctionAndRightLiteral
public boolean isLeftFunctionAndRightLiteral() -
isNameAndLiteral
public boolean isNameAndLiteral() -
isBothName
public boolean isBothName() -
compareTo
- Specified by:
compareToin interfaceComparable<SQLBinaryOpExpr>
-
isLeftLiteralAndRightName
public boolean isLeftLiteralAndRightName() -
conditionEq
-
conditionEq
-
conditionLike
-
conditionLike
-
eq
-