mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
删除无用DDL部分代码
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@867 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
-48
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* 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.oracle.ast.stmt;
|
||||
|
||||
import com.alibaba.druid.sql.ast.statement.SQLCreateTableStatement;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class OracleCreateTableStatement extends SQLCreateTableStatement {
|
||||
|
||||
public OracleCreateTableStatement(){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void output(StringBuffer buf) {
|
||||
if (Type.GLOBAL_TEMPORARY.equals(this.type)) {
|
||||
buf.append("CREATE GLOBAL TEMPORARY TABLE ");
|
||||
} else if (Type.LOCAL_TEMPORARY.equals(this.type)) {
|
||||
buf.append("CREATE LOCAL TEMPORARY TABLE ");
|
||||
} else {
|
||||
buf.append("CREATE TABLE ");
|
||||
}
|
||||
|
||||
this.name.output(buf);
|
||||
buf.append(" ");
|
||||
buf.append("(");
|
||||
for (int i = 0, size = tableElementList.size(); i < size; ++i) {
|
||||
if (i != 0) {
|
||||
buf.append(", ");
|
||||
}
|
||||
tableElementList.get(i).output(buf);
|
||||
}
|
||||
buf.append(")");
|
||||
}
|
||||
}
|
||||
-56
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* 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.oracle.ast.stmt;
|
||||
|
||||
import com.alibaba.druid.sql.ast.statement.SQLCreateViewStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.visitor.OracleASTVisitor;
|
||||
|
||||
public class OracleCreateViewStatement extends SQLCreateViewStatement {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private boolean replace = false;
|
||||
private Boolean force;
|
||||
|
||||
public OracleCreateViewStatement(){
|
||||
|
||||
}
|
||||
|
||||
protected void accept0(OracleASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, this.name);
|
||||
acceptChild(visitor, this.subQuery);
|
||||
}
|
||||
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
|
||||
public Boolean getForce() {
|
||||
return this.force;
|
||||
}
|
||||
|
||||
public void setForce(Boolean force) {
|
||||
this.force = force;
|
||||
}
|
||||
|
||||
public boolean isReplace() {
|
||||
return this.replace;
|
||||
}
|
||||
|
||||
public void setReplace(boolean replace) {
|
||||
this.replace = replace;
|
||||
}
|
||||
}
|
||||
@@ -19,8 +19,6 @@ import java.util.List;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLStatement;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLSelectStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleCreateTableStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleCreateViewStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OraclePLSQLCommitStatement;
|
||||
import com.alibaba.druid.sql.parser.Lexer;
|
||||
import com.alibaba.druid.sql.parser.ParserException;
|
||||
@@ -117,61 +115,4 @@ public class OracleStatementParser extends SQLStatementParser {
|
||||
}
|
||||
}
|
||||
|
||||
public OracleCreateTableStatement parseOracleCreateTable() throws ParserException {
|
||||
// OracleCreateTableParser parser = new OracleCreateTableParser(this.tokenList);
|
||||
// return parser.parseCrateTable();
|
||||
throw new ParserException("TODO");
|
||||
}
|
||||
|
||||
public OracleCreateViewStatement parseCreateView() throws ParserException {
|
||||
OracleCreateViewStatement createView = new OracleCreateViewStatement();
|
||||
|
||||
accept(Token.CREATE);
|
||||
if (lexer.token() == (Token.OR)) {
|
||||
lexer.nextToken();
|
||||
|
||||
if (identifierEquals("REPLACE")) lexer.nextToken();
|
||||
else {
|
||||
throw new ParserException("syntax error");
|
||||
}
|
||||
|
||||
createView.setReplace(true);
|
||||
}
|
||||
|
||||
if (identifierEquals("NO")) {
|
||||
lexer.nextToken();
|
||||
|
||||
if (identifierEquals("FORCE")) lexer.nextToken();
|
||||
else {
|
||||
throw new ParserException("syntax error");
|
||||
}
|
||||
|
||||
createView.setForce(Boolean.FALSE);
|
||||
}
|
||||
|
||||
if (identifierEquals("FORCE")) {
|
||||
lexer.nextToken();
|
||||
createView.setForce(Boolean.TRUE);
|
||||
}
|
||||
|
||||
accept(Token.VIEW);
|
||||
|
||||
// createView.setName(new OracleExprParser(this.lexer).name());
|
||||
//
|
||||
//
|
||||
// if (this.tokenList.lookup(1).equals(Token.OpenBraceToken)) {
|
||||
// throw new ParserException("TODO");
|
||||
// }
|
||||
//
|
||||
// if (this.tokenList.lookup(1).equals(Token.OfToken)) {
|
||||
// throw new ParserException("TODO");
|
||||
// }
|
||||
//
|
||||
// accept(Token.AsToken);
|
||||
//
|
||||
// createView.setSubQuery(new OracleSelectParser(this.tokenList).select());
|
||||
// return createView;
|
||||
|
||||
throw new ParserException("TODO");
|
||||
}
|
||||
}
|
||||
|
||||
-12
@@ -32,7 +32,6 @@ import com.alibaba.druid.sql.dialect.oracle.ast.expr.OracleTimestampExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleCheck;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleConstraintNull;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleConstraintState;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleCreateViewStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleDeleteStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleForeignKey;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleOrderByItem;
|
||||
@@ -118,11 +117,6 @@ public class OracleASTVIsitorAdapter extends SQLASTVisitorAdapter implements Ora
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleCreateViewStatement x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleDataTypeInterval x) {
|
||||
|
||||
@@ -343,12 +337,6 @@ public class OracleASTVIsitorAdapter extends SQLASTVisitorAdapter implements Ora
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleCreateViewStatement x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleDataTypeInterval x) {
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ import com.alibaba.druid.sql.dialect.oracle.ast.expr.OracleTimestampExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleCheck;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleConstraintNull;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleConstraintState;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleCreateViewStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleDeleteStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleForeignKey;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleOrderByItem;
|
||||
@@ -93,8 +92,6 @@ public interface OracleASTVisitor extends SQLASTVisitor {
|
||||
|
||||
void endVisit(OracleArrayAccessExpr x);
|
||||
|
||||
void endVisit(OracleCreateViewStatement x);
|
||||
|
||||
void endVisit(OracleDataTypeInterval x);
|
||||
|
||||
void endVisit(OracleRefDataType x);
|
||||
@@ -179,8 +176,6 @@ public interface OracleASTVisitor extends SQLASTVisitor {
|
||||
|
||||
boolean visit(OracleArrayAccessExpr x);
|
||||
|
||||
boolean visit(OracleCreateViewStatement x);
|
||||
|
||||
boolean visit(OracleDataTypeInterval x);
|
||||
|
||||
boolean visit(OracleRefDataType x);
|
||||
|
||||
@@ -59,7 +59,6 @@ import com.alibaba.druid.sql.dialect.oracle.ast.expr.OracleTimestampExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleCheck;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleConstraintNull;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleConstraintState;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleCreateViewStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleDeleteStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleForeignKey;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleOrderByItem;
|
||||
@@ -205,30 +204,6 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(OracleCreateViewStatement x) {
|
||||
print("CREATE ");
|
||||
if (x.isReplace()) {
|
||||
print("OR REPLACE ");
|
||||
}
|
||||
|
||||
if (Boolean.TRUE.equals(x.getForce())) {
|
||||
print("FORCE ");
|
||||
} else if (Boolean.FALSE.equals(x.getForce())) {
|
||||
print("NO FORCE ");
|
||||
}
|
||||
|
||||
print("VIEW ");
|
||||
|
||||
x.getName().accept(this);
|
||||
|
||||
println();
|
||||
print("AS");
|
||||
println();
|
||||
x.getSubQuery().accept(this);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(OracleDataTypeInterval x) {
|
||||
print("INTERVAL ");
|
||||
print(x.getType().name());
|
||||
@@ -930,11 +905,6 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleCreateViewStatement x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(SQLDataType x) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user