mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 1999-2017 Alibaba Group Holding Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.alibaba.druid.sql.dialect.sqlserver.ast;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLObjectImpl;
|
||||
import com.alibaba.druid.sql.ast.SQLStatementImpl;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.visitor.SQLServerASTVisitor;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
public abstract class SQLServerStatementImpl extends SQLStatementImpl implements SQLServerStatement {
|
||||
|
||||
public SQLServerStatementImpl(){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
this.accept0((SQLServerASTVisitor) visitor);
|
||||
}
|
||||
|
||||
public abstract void accept0(SQLServerASTVisitor visitor);
|
||||
}
|
||||
+2
-11
@@ -18,9 +18,10 @@ package com.alibaba.druid.sql.dialect.sqlserver.ast.stmt;
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerObjectImpl;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerStatement;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerStatementImpl;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.visitor.SQLServerASTVisitor;
|
||||
|
||||
public class SQLServerCommitStatement extends SQLServerObjectImpl implements SQLServerStatement {
|
||||
public class SQLServerCommitStatement extends SQLServerStatementImpl implements SQLServerStatement {
|
||||
|
||||
private boolean work = false;
|
||||
|
||||
@@ -28,8 +29,6 @@ public class SQLServerCommitStatement extends SQLServerObjectImpl implements SQL
|
||||
|
||||
private SQLExpr delayedDurability;
|
||||
|
||||
private String dbType;
|
||||
|
||||
public boolean isWork() {
|
||||
return work;
|
||||
}
|
||||
@@ -61,12 +60,4 @@ public class SQLServerCommitStatement extends SQLServerObjectImpl implements SQL
|
||||
public void setDelayedDurability(SQLExpr delayedDurability) {
|
||||
this.delayedDurability = delayedDurability;
|
||||
}
|
||||
|
||||
public String getDbType() {
|
||||
return dbType;
|
||||
}
|
||||
|
||||
public void setDbType(String dbType) {
|
||||
this.dbType = dbType;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-11
@@ -22,14 +22,14 @@ import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.ast.SQLName;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerObjectImpl;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerStatement;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerStatementImpl;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.visitor.SQLServerASTVisitor;
|
||||
|
||||
public class SQLServerExecStatement extends SQLServerObjectImpl implements SQLServerStatement {
|
||||
public class SQLServerExecStatement extends SQLServerStatementImpl implements SQLServerStatement {
|
||||
|
||||
private SQLName returnStatus;
|
||||
private SQLName moduleName;
|
||||
private List<SQLServerParameter> parameters = new ArrayList<SQLServerParameter>();
|
||||
private String dbType;
|
||||
|
||||
public SQLName getModuleName() {
|
||||
return moduleName;
|
||||
@@ -59,15 +59,7 @@ public class SQLServerExecStatement extends SQLServerObjectImpl implements SQLSe
|
||||
public void setReturnStatus(SQLName returnStatus) {
|
||||
this.returnStatus = returnStatus;
|
||||
}
|
||||
|
||||
public String getDbType() {
|
||||
return dbType;
|
||||
}
|
||||
|
||||
public void setDbType(String dbType) {
|
||||
this.dbType = dbType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zz [455910092@qq.com]
|
||||
|
||||
+2
-10
@@ -19,12 +19,12 @@ import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLAssignItem;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerObjectImpl;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerStatement;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerStatementImpl;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.visitor.SQLServerASTVisitor;
|
||||
|
||||
public class SQLServerSetStatement extends SQLServerObjectImpl implements SQLServerStatement {
|
||||
public class SQLServerSetStatement extends SQLServerStatementImpl implements SQLServerStatement {
|
||||
|
||||
private SQLAssignItem item = new SQLAssignItem();
|
||||
private String dbType;
|
||||
|
||||
public SQLServerSetStatement(){
|
||||
}
|
||||
@@ -53,12 +53,4 @@ public class SQLServerSetStatement extends SQLServerObjectImpl implements SQLSer
|
||||
}
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
|
||||
public String getDbType() {
|
||||
return dbType;
|
||||
}
|
||||
|
||||
public void setDbType(String dbType) {
|
||||
this.dbType = dbType;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-10
@@ -17,12 +17,12 @@ package com.alibaba.druid.sql.dialect.sqlserver.ast.stmt;
|
||||
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerObjectImpl;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerStatement;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerStatementImpl;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.visitor.SQLServerASTVisitor;
|
||||
|
||||
public class SQLServerSetTransactionIsolationLevelStatement extends SQLServerObjectImpl implements SQLServerStatement {
|
||||
public class SQLServerSetTransactionIsolationLevelStatement extends SQLServerStatementImpl implements SQLServerStatement {
|
||||
|
||||
private String level;
|
||||
private String dbType;
|
||||
|
||||
@Override
|
||||
public void accept0(SQLServerASTVisitor visitor) {
|
||||
@@ -37,12 +37,4 @@ public class SQLServerSetTransactionIsolationLevelStatement extends SQLServerObj
|
||||
public void setLevel(String level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public String getDbType() {
|
||||
return dbType;
|
||||
}
|
||||
|
||||
public void setDbType(String dbType) {
|
||||
this.dbType = dbType;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-11
@@ -19,9 +19,10 @@ import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.ast.SQLStatement;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerObjectImpl;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerStatement;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerStatementImpl;
|
||||
import com.alibaba.druid.sql.dialect.sqlserver.visitor.SQLServerASTVisitor;
|
||||
|
||||
public class SQLServerWaitForStatement extends SQLServerObjectImpl implements SQLServerStatement {
|
||||
public class SQLServerWaitForStatement extends SQLServerStatementImpl implements SQLServerStatement {
|
||||
|
||||
private SQLExpr delay;
|
||||
|
||||
@@ -31,8 +32,6 @@ public class SQLServerWaitForStatement extends SQLServerObjectImpl implements SQ
|
||||
|
||||
private SQLExpr timeout;
|
||||
|
||||
private String dbType;
|
||||
|
||||
@Override
|
||||
public void accept0(SQLServerASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
@@ -75,12 +74,4 @@ public class SQLServerWaitForStatement extends SQLServerObjectImpl implements SQ
|
||||
public void setTimeout(SQLExpr timeout) {
|
||||
this.timeout = timeout;
|
||||
}
|
||||
|
||||
public String getDbType() {
|
||||
return dbType;
|
||||
}
|
||||
|
||||
public void setDbType(String dbType) {
|
||||
this.dbType = dbType;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user