mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
@@ -36,7 +36,7 @@ public class SQLCreateTriggerStatement extends SQLStatementImpl implements SQLCr
|
||||
private boolean delete;
|
||||
private boolean insert;
|
||||
|
||||
private SQLName on;
|
||||
private SQLExprTableSource on;
|
||||
|
||||
private boolean forEachRow = false;
|
||||
|
||||
@@ -64,11 +64,18 @@ public class SQLCreateTriggerStatement extends SQLStatementImpl implements SQLCr
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
|
||||
public SQLName getOn() {
|
||||
public SQLExprTableSource getOn() {
|
||||
return on;
|
||||
}
|
||||
|
||||
public void setOn(SQLName on) {
|
||||
this.setOn(new SQLExprTableSource(on));
|
||||
}
|
||||
|
||||
public void setOn(SQLExprTableSource on) {
|
||||
if (on != null) {
|
||||
on.setParent(this);
|
||||
}
|
||||
this.on = on;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.alibaba.druid.sql.ast.statement;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.ast.SQLName;
|
||||
import com.alibaba.druid.sql.ast.SQLStatementImpl;
|
||||
import com.alibaba.druid.sql.ast.expr.SQLQueryExpr;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SQLReplaceStatement extends SQLStatementImpl {
|
||||
protected boolean lowPriority = false;
|
||||
protected boolean delayed = false;
|
||||
|
||||
protected SQLExprTableSource tableSource;
|
||||
protected final List<SQLExpr> columns = new ArrayList<SQLExpr>();
|
||||
protected List<SQLInsertStatement.ValuesClause> valuesList = new ArrayList<SQLInsertStatement.ValuesClause>();
|
||||
protected SQLQueryExpr query;
|
||||
|
||||
|
||||
public SQLName getTableName() {
|
||||
if (tableSource == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (SQLName) tableSource.getExpr();
|
||||
}
|
||||
|
||||
public void setTableName(SQLName tableName) {
|
||||
this.setTableSource(new SQLExprTableSource(tableName));
|
||||
}
|
||||
|
||||
public SQLExprTableSource getTableSource() {
|
||||
return tableSource;
|
||||
}
|
||||
|
||||
public void setTableSource(SQLExprTableSource tableSource) {
|
||||
if (tableSource != null) {
|
||||
tableSource.setParent(this);
|
||||
}
|
||||
this.tableSource = tableSource;
|
||||
}
|
||||
|
||||
public List<SQLExpr> getColumns() {
|
||||
return columns;
|
||||
}
|
||||
|
||||
public void addColumn(SQLExpr column) {
|
||||
if (column != null) {
|
||||
column.setParent(this);
|
||||
}
|
||||
this.columns.add(column);
|
||||
}
|
||||
|
||||
public boolean isLowPriority() {
|
||||
return lowPriority;
|
||||
}
|
||||
|
||||
public void setLowPriority(boolean lowPriority) {
|
||||
this.lowPriority = lowPriority;
|
||||
}
|
||||
|
||||
public boolean isDelayed() {
|
||||
return delayed;
|
||||
}
|
||||
|
||||
public void setDelayed(boolean delayed) {
|
||||
this.delayed = delayed;
|
||||
}
|
||||
|
||||
public SQLQueryExpr getQuery() {
|
||||
return query;
|
||||
}
|
||||
|
||||
public void setQuery(SQLQueryExpr query) {
|
||||
if (query != null) {
|
||||
query.setParent(this);
|
||||
}
|
||||
this.query = query;
|
||||
}
|
||||
|
||||
public List<SQLInsertStatement.ValuesClause> getValuesList() {
|
||||
return valuesList;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, tableSource);
|
||||
acceptChild(visitor, columns);
|
||||
acceptChild(visitor, valuesList);
|
||||
acceptChild(visitor, query);
|
||||
}
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import com.alibaba.druid.sql.ast.SQLOrderingSpecification;
|
||||
import com.alibaba.druid.sql.ast.SQLReplaceable;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
public class SQLSelectOrderByItem extends SQLObjectImpl implements SQLReplaceable {
|
||||
public final class SQLSelectOrderByItem extends SQLObjectImpl implements SQLReplaceable {
|
||||
|
||||
protected SQLExpr expr;
|
||||
protected String collate;
|
||||
|
||||
Reference in New Issue
Block a user