forked from alibaba/druid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yako
authored and
Yako
committed
Sep 24, 2014
1 parent
e7829a7
commit 5049285
Showing
10 changed files
with
409 additions
and
2 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
src/main/java/com/alibaba/druid/sql/dialect/sqlserver/ast/stmt/SQLServerBlockStatement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 1999-2011 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.stmt; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
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.visitor.SQLServerASTVisitor; | ||
|
||
public class SQLServerBlockStatement extends SQLServerObjectImpl implements SQLServerStatement { | ||
|
||
private List<SQLStatement> statementList = new ArrayList<SQLStatement>(); | ||
|
||
public List<SQLStatement> getStatementList() { | ||
return statementList; | ||
} | ||
|
||
public void setStatementList(List<SQLStatement> statementList) { | ||
this.statementList = statementList; | ||
} | ||
|
||
@Override | ||
public void accept0(SQLServerASTVisitor visitor) { | ||
if (visitor.visit(this)) { | ||
acceptChild(visitor, statementList); | ||
} | ||
visitor.endVisit(this); | ||
} | ||
|
||
} |
89 changes: 89 additions & 0 deletions
89
src/main/java/com/alibaba/druid/sql/dialect/sqlserver/ast/stmt/SQLServerIfStatement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* Copyright 1999-2011 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.stmt; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
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.visitor.SQLServerASTVisitor; | ||
|
||
public class SQLServerIfStatement extends SQLServerObjectImpl implements SQLServerStatement { | ||
|
||
private SQLExpr condition; | ||
private List<SQLStatement> statements = new ArrayList<SQLStatement>(); | ||
private Else elseItem; | ||
|
||
@Override | ||
public void accept0(SQLServerASTVisitor visitor) { | ||
if (visitor.visit(this)) { | ||
acceptChild(visitor, condition); | ||
acceptChild(visitor, statements); | ||
acceptChild(visitor, elseItem); | ||
} | ||
visitor.endVisit(this); | ||
} | ||
|
||
public SQLExpr getCondition() { | ||
return condition; | ||
} | ||
|
||
public void setCondition(SQLExpr condition) { | ||
this.condition = condition; | ||
} | ||
|
||
public List<SQLStatement> getStatements() { | ||
return statements; | ||
} | ||
|
||
public void setStatements(List<SQLStatement> statements) { | ||
this.statements = statements; | ||
} | ||
|
||
public Else getElseItem() { | ||
return elseItem; | ||
} | ||
|
||
public void setElseItem(Else elseItem) { | ||
this.elseItem = elseItem; | ||
} | ||
|
||
public static class Else extends SQLServerObjectImpl { | ||
|
||
private List<SQLStatement> statements = new ArrayList<SQLStatement>(); | ||
|
||
@Override | ||
public void accept0(SQLServerASTVisitor visitor) { | ||
if (visitor.visit(this)) { | ||
acceptChild(visitor, statements); | ||
} | ||
visitor.endVisit(this); | ||
} | ||
|
||
public List<SQLStatement> getStatements() { | ||
return statements; | ||
} | ||
|
||
public void setStatements(List<SQLStatement> statements) { | ||
this.statements = statements; | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.