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.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()only for parameterized outputgetRight()inthashCode()static booleanbooleanbooleanbooleanbooleanbooleanstatic SQLBinaryOpExprstatic SQLBinaryOpExprstatic booleanbooleanstatic SQLBinaryOpExpronly for parameterized outputstatic SQLExprstatic SQLExprbooleanvoidvoidvoidsetOperator(SQLBinaryOperator operator) voidsetParenthesized(boolean parenthesized) voidsplit(SQLExpr x, SQLBinaryOperator op) static voidsplit(List<SQLExpr> outList, SQLExpr expr, SQLBinaryOperator op) toString()Methods 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, 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, 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
-
isParenthesized
public boolean isParenthesized() -
setParenthesized
public void setParenthesized(boolean parenthesized) -
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
only for parameterized output- Parameters:
v-x-- Returns:
-
getMergedList
only for parameterized output- Returns:
-
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
-