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@866 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -1,53 +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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLName;
|
||||
import com.alibaba.druid.sql.dialect.oracle.visitor.OracleASTVisitor;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
public class OraclePrimaryKey extends OracleConstraint {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final List<SQLName> columns = new ArrayList<SQLName>();
|
||||
|
||||
public OraclePrimaryKey(){
|
||||
|
||||
}
|
||||
|
||||
public List<SQLName> getColumns() {
|
||||
return this.columns;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
this.accept0((OracleASTVisitor) visitor);
|
||||
}
|
||||
|
||||
protected void accept0(OracleASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, this.name);
|
||||
acceptChild(visitor, this.columns);
|
||||
acceptChild(visitor, this.state);
|
||||
}
|
||||
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
}
|
||||
@@ -1,112 +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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLDataType;
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.OracleSQLObject;
|
||||
import com.alibaba.druid.sql.dialect.oracle.visitor.OracleASTVisitor;
|
||||
|
||||
public class OracleTableColumn extends OracleSQLObject {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private boolean sort;
|
||||
private SQLDataType dataType;
|
||||
private SQLExpr defaultValue;
|
||||
private final List<OracleConstraint> constaints = new ArrayList<OracleConstraint>();
|
||||
private String name;
|
||||
private boolean generatedAlways;
|
||||
private SQLExpr as;
|
||||
private boolean virtual = false;
|
||||
|
||||
public OracleTableColumn(){
|
||||
|
||||
}
|
||||
|
||||
protected void accept0(OracleASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, this.dataType);
|
||||
acceptChild(visitor, this.defaultValue);
|
||||
acceptChild(visitor, this.constaints);
|
||||
acceptChild(visitor, this.as);
|
||||
}
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
|
||||
public SQLDataType getDataType() {
|
||||
return this.dataType;
|
||||
}
|
||||
|
||||
public void setDataType(SQLDataType dataType) {
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
public boolean isGeneratedAlways() {
|
||||
return this.generatedAlways;
|
||||
}
|
||||
|
||||
public void setGeneratedAlways(boolean generatedAlways) {
|
||||
this.generatedAlways = generatedAlways;
|
||||
}
|
||||
|
||||
public SQLExpr getAs() {
|
||||
return this.as;
|
||||
}
|
||||
|
||||
public void setAs(SQLExpr as) {
|
||||
this.as = as;
|
||||
}
|
||||
|
||||
public boolean isVirtual() {
|
||||
return this.virtual;
|
||||
}
|
||||
|
||||
public void setVirtual(boolean virtual) {
|
||||
this.virtual = virtual;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public boolean isSort() {
|
||||
return this.sort;
|
||||
}
|
||||
|
||||
public void setSort(boolean sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public SQLExpr getDefaultValue() {
|
||||
return this.defaultValue;
|
||||
}
|
||||
|
||||
public void setDefaultValue(SQLExpr defaultValue) {
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public List<OracleConstraint> getConstaints() {
|
||||
return this.constaints;
|
||||
}
|
||||
}
|
||||
@@ -1,278 +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.parser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleCheck;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleConstraint;
|
||||
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.OracleForeignKey;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OraclePrimaryKey;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleReferencesConstaint;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTableColumn;
|
||||
import com.alibaba.druid.sql.parser.Lexer;
|
||||
import com.alibaba.druid.sql.parser.ParserException;
|
||||
import com.alibaba.druid.sql.parser.SQLStatementParser;
|
||||
import com.alibaba.druid.sql.parser.Token;
|
||||
|
||||
public abstract class OracleDDLParser extends SQLStatementParser {
|
||||
|
||||
public OracleDDLParser(String sql) throws ParserException{
|
||||
super(sql);
|
||||
}
|
||||
|
||||
public OracleDDLParser(Lexer lexer){
|
||||
super(lexer);
|
||||
}
|
||||
|
||||
protected boolean parseConstaint(List<OracleConstraint> constaints) throws ParserException {
|
||||
String constaintName = null;
|
||||
if (lexer.token() == Token.CONSTRAINT) {
|
||||
lexer.nextToken();
|
||||
if (lexer.token() == Token.IDENTIFIER) {
|
||||
constaintName = lexer.stringVal();
|
||||
lexer.nextToken();
|
||||
}
|
||||
}
|
||||
|
||||
if (lexer.token() == (Token.CHECK)) {
|
||||
lexer.nextToken();
|
||||
OracleCheck check = new OracleCheck();
|
||||
check.setName(constaintName);
|
||||
accept(Token.LPAREN);
|
||||
check.setCondition(this.exprParser.expr());
|
||||
accept(Token.RPAREN);
|
||||
|
||||
check.setState(parseConstraintState());
|
||||
|
||||
constaints.add(check);
|
||||
|
||||
return true;
|
||||
}
|
||||
OracleConstraintNull nullable;
|
||||
if (lexer.token() == (Token.NOT)) {
|
||||
lexer.nextToken();
|
||||
accept(Token.NULL);
|
||||
|
||||
nullable = new OracleConstraintNull();
|
||||
nullable.setName(constaintName);
|
||||
nullable.setNullable(false);
|
||||
|
||||
nullable.setState(parseConstraintState());
|
||||
|
||||
constaints.add(nullable);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (lexer.token() == (Token.NULL)) {
|
||||
lexer.nextToken();
|
||||
|
||||
nullable = new OracleConstraintNull();
|
||||
nullable.setName(constaintName);
|
||||
nullable.setNullable(true);
|
||||
|
||||
nullable.setState(parseConstraintState());
|
||||
|
||||
constaints.add(nullable);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (lexer.token() == (Token.UNIQUE)) {
|
||||
throw new ParserException("TODO");
|
||||
}
|
||||
|
||||
if (lexer.token() == (Token.REFERENCE)) {
|
||||
throw new ParserException("TODO");
|
||||
}
|
||||
|
||||
if (lexer.token() == (Token.FOREIGN)) {
|
||||
lexer.nextToken();
|
||||
accept(Token.KEY);
|
||||
|
||||
OracleForeignKey foreignKey = new OracleForeignKey();
|
||||
|
||||
foreignKey.setName(constaintName);
|
||||
|
||||
accept(Token.LPAREN);
|
||||
this.exprParser.names(foreignKey.getColumns());
|
||||
accept(Token.RPAREN);
|
||||
|
||||
accept(Token.REFERENCE);
|
||||
foreignKey.setRefObject(this.exprParser.name());
|
||||
|
||||
if (lexer.token() == (Token.LPAREN)) {
|
||||
lexer.nextToken();
|
||||
this.exprParser.names(foreignKey.getRefColumns());
|
||||
accept(Token.RPAREN);
|
||||
}
|
||||
|
||||
if (lexer.token() == (Token.ON)) {
|
||||
lexer.nextToken();
|
||||
accept(Token.DELETE);
|
||||
|
||||
if (identifierEquals("CASCADE")) {
|
||||
throw new RuntimeException("TODO");
|
||||
} else {
|
||||
throw new RuntimeException("TODO");
|
||||
}
|
||||
}
|
||||
|
||||
foreignKey.setState(parseConstraintState());
|
||||
|
||||
constaints.add(foreignKey);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (lexer.token() == (Token.SCHEMA)) {
|
||||
throw new ParserException("TODO");
|
||||
}
|
||||
|
||||
if (lexer.token() == (Token.PRIMARY)) {
|
||||
lexer.nextToken();
|
||||
accept(Token.KEY);
|
||||
|
||||
OraclePrimaryKey primaryKey = new OraclePrimaryKey();
|
||||
primaryKey.setName(constaintName);
|
||||
|
||||
if (lexer.token() == (Token.LPAREN)) {
|
||||
lexer.nextToken();
|
||||
this.exprParser.names(primaryKey.getColumns());
|
||||
accept(Token.RPAREN);
|
||||
}
|
||||
|
||||
primaryKey.setState(parseConstraintState());
|
||||
|
||||
constaints.add(primaryKey);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (identifierEquals("SCOPE")) {
|
||||
lexer.nextToken();
|
||||
|
||||
if (lexer.token() == (Token.IS)) {
|
||||
throw new RuntimeException("TODO");
|
||||
}
|
||||
if (identifierEquals("FOR")) {
|
||||
throw new ParserException("TODO");
|
||||
}
|
||||
throw new ParserException("TODO");
|
||||
}
|
||||
|
||||
if (identifierEquals("REF")) {
|
||||
throw new ParserException("TODO");
|
||||
}
|
||||
|
||||
if (identifierEquals("References")) {
|
||||
lexer.nextToken();
|
||||
OracleReferencesConstaint ref = new OracleReferencesConstaint();
|
||||
ref.setRefObject(this.exprParser.name());
|
||||
|
||||
if (lexer.token() == (Token.LPAREN)) {
|
||||
lexer.nextToken();
|
||||
this.exprParser.names(ref.getRefColumns());
|
||||
accept(Token.RPAREN);
|
||||
}
|
||||
|
||||
if (lexer.token() == (Token.ON)) {
|
||||
lexer.nextToken();
|
||||
accept(Token.DELETE);
|
||||
|
||||
if (identifierEquals("CASCADE")) {
|
||||
throw new RuntimeException("TODO");
|
||||
} else {
|
||||
throw new RuntimeException("TODO");
|
||||
}
|
||||
}
|
||||
constaints.add(ref);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected OracleConstraintState parseConstraintState() throws ParserException {
|
||||
OracleConstraintState state = null;
|
||||
while (true) {
|
||||
if (identifierEquals("DEFERRABLE")) {
|
||||
throw new ParserException("TODO");
|
||||
}
|
||||
|
||||
if (identifierEquals("INITIALY")) throw new ParserException("TODO");
|
||||
if (identifierEquals("RELY")) throw new ParserException("TODO");
|
||||
if (identifierEquals("NORELY")) throw new ParserException("TODO");
|
||||
if (identifierEquals("USING")) throw new ParserException("TODO");
|
||||
if (identifierEquals("ENABLE")) throw new ParserException("TODO");
|
||||
if (identifierEquals("DISABLE")) break;
|
||||
if (state == null) {
|
||||
state = new OracleConstraintState();
|
||||
}
|
||||
|
||||
lexer.nextToken();
|
||||
if (identifierEquals("CASCADE")) {
|
||||
lexer.nextToken();
|
||||
state.getStates().add(new SQLIdentifierExpr("DISABLE CASCADE"));
|
||||
}
|
||||
state.getStates().add(new SQLIdentifierExpr("DISABLE"));
|
||||
}
|
||||
|
||||
if (identifierEquals("VALIDATE")) throw new ParserException("TODO");
|
||||
if (identifierEquals("NOVALIDATE")) throw new ParserException("TODO");
|
||||
if (identifierEquals("EXCEPTIONS")) {
|
||||
throw new ParserException("TODO");
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
protected void parsePhysicalAttributesClause() throws ParserException {
|
||||
if (identifierEquals("PCTREE")) throw new ParserException("TODO");
|
||||
if (identifierEquals("PCTUSED")) throw new ParserException("TODO");
|
||||
if (identifierEquals("INITRANS")) throw new ParserException("TODO");
|
||||
if (identifierEquals("STORAGE")) throw new ParserException("TODO");
|
||||
}
|
||||
|
||||
protected OracleTableColumn parseColumn() throws ParserException {
|
||||
OracleTableColumn column = new OracleTableColumn();
|
||||
|
||||
if (lexer.token() != Token.IDENTIFIER) {
|
||||
throw new ParserException("syntax error");
|
||||
}
|
||||
|
||||
column.setName(lexer.stringVal());
|
||||
lexer.nextToken();
|
||||
column.setDataType(this.exprParser.parseDataType());
|
||||
|
||||
if (identifierEquals("SORT")) {
|
||||
lexer.nextToken();
|
||||
column.setSort(true);
|
||||
}
|
||||
|
||||
if (identifierEquals("DEFAULT")) {
|
||||
lexer.nextToken();
|
||||
column.setDefaultValue(this.exprParser.expr());
|
||||
}
|
||||
|
||||
if (identifierEquals("ENCTRYPT")) {
|
||||
throw new ParserException("TODO");
|
||||
}
|
||||
return column;
|
||||
}
|
||||
}
|
||||
-24
@@ -37,7 +37,6 @@ 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;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OraclePLSQLCommitStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OraclePrimaryKey;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleRefDataType;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleReferencesConstaint;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelect;
|
||||
@@ -51,7 +50,6 @@ import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectRestriction.Rea
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectSubqueryTableSource;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectTableReference;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectUnPivot;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTableColumn;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTableExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTableTypeDef;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetListClause;
|
||||
@@ -105,11 +103,6 @@ public class OracleASTVIsitorAdapter extends SQLASTVisitorAdapter implements Ora
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OraclePrimaryKey astNode) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleAnalytic x) {
|
||||
|
||||
@@ -250,11 +243,6 @@ public class OracleASTVIsitorAdapter extends SQLASTVisitorAdapter implements Ora
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleTableColumn x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleTableExpr x) {
|
||||
|
||||
@@ -337,12 +325,6 @@ public class OracleASTVIsitorAdapter extends SQLASTVisitorAdapter implements Ora
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OraclePrimaryKey astNode) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleAnalytic x) {
|
||||
|
||||
@@ -511,12 +493,6 @@ public class OracleASTVIsitorAdapter extends SQLASTVisitorAdapter implements Ora
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleTableColumn x) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(OracleTableExpr x) {
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ 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;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OraclePLSQLCommitStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OraclePrimaryKey;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleRefDataType;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleReferencesConstaint;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelect;
|
||||
@@ -63,7 +62,6 @@ import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectRestriction;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectSubqueryTableSource;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectTableReference;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectUnPivot;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTableColumn;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTableExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTableTypeDef;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetListClause;
|
||||
@@ -89,8 +87,6 @@ public interface OracleASTVisitor extends SQLASTVisitor {
|
||||
|
||||
void endVisit(OracleCheck astNode);
|
||||
|
||||
void endVisit(OraclePrimaryKey astNode);
|
||||
|
||||
void endVisit(OracleAnalytic x);
|
||||
|
||||
void endVisit(OracleAnalyticWindowing x);
|
||||
@@ -147,8 +143,6 @@ public interface OracleASTVisitor extends SQLASTVisitor {
|
||||
|
||||
void endVisit(OracleTableCollectionExpr x);
|
||||
|
||||
void endVisit(OracleTableColumn x);
|
||||
|
||||
void endVisit(OracleTableExpr x);
|
||||
|
||||
void endVisit(OracleTableTypeDef x);
|
||||
@@ -179,8 +173,6 @@ public interface OracleASTVisitor extends SQLASTVisitor {
|
||||
|
||||
boolean visit(OracleCheck astNode);
|
||||
|
||||
boolean visit(OraclePrimaryKey astNode);
|
||||
|
||||
boolean visit(OracleAnalytic x);
|
||||
|
||||
boolean visit(OracleAnalyticWindowing x);
|
||||
@@ -237,8 +229,6 @@ public interface OracleASTVisitor extends SQLASTVisitor {
|
||||
|
||||
boolean visit(OracleTableCollectionExpr x);
|
||||
|
||||
boolean visit(OracleTableColumn x);
|
||||
|
||||
boolean visit(OracleTableExpr x);
|
||||
|
||||
boolean visit(OracleTableTypeDef x);
|
||||
|
||||
@@ -57,7 +57,6 @@ import com.alibaba.druid.sql.dialect.oracle.ast.expr.OraclePriorExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.expr.OracleTableCollectionExpr;
|
||||
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.OracleConstraint;
|
||||
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;
|
||||
@@ -65,7 +64,6 @@ 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;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OraclePLSQLCommitStatement;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OraclePrimaryKey;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleRefDataType;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleReferencesConstaint;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelect;
|
||||
@@ -81,7 +79,6 @@ import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectRestriction.Rea
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectSubqueryTableSource;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectTableReference;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectUnPivot;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTableColumn;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTableExpr;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleTableTypeDef;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleUpdateSetListClause;
|
||||
@@ -410,21 +407,6 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(OraclePrimaryKey node) {
|
||||
if (node.getName() != null) {
|
||||
print("CONSTAINT ");
|
||||
node.getName().accept(this);
|
||||
print(" ");
|
||||
}
|
||||
print("PRIMARY KEY");
|
||||
if (node.getColumns().size() > 0) {
|
||||
print(" (");
|
||||
printAndAccept(node.getColumns(), ", ");
|
||||
print(")");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(OracleRefDataType x) {
|
||||
print("REF ");
|
||||
x.getRefObject().accept(this);
|
||||
@@ -784,45 +766,6 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(OracleTableColumn x) {
|
||||
print(x.getName());
|
||||
|
||||
if (x.getDataType() != null) {
|
||||
print(" ");
|
||||
x.getDataType().accept(this);
|
||||
}
|
||||
|
||||
if (x.isSort()) {
|
||||
print(" SORT");
|
||||
}
|
||||
|
||||
if (x.isGeneratedAlways()) {
|
||||
print(" GENERATED ALWAYS");
|
||||
}
|
||||
|
||||
if (x.getDefaultValue() != null) {
|
||||
print(" DEFAULT ");
|
||||
x.getDefaultValue().accept(this);
|
||||
}
|
||||
|
||||
if (x.getAs() != null) {
|
||||
print(" AS ");
|
||||
x.getAs().accept(this);
|
||||
}
|
||||
|
||||
if (x.isVirtual()) {
|
||||
print(" VIRTUAL");
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
for (int size = x.getConstaints().size(); i < size; ++i) {
|
||||
print(" ");
|
||||
((OracleConstraint) x.getConstaints().get(i)).accept(this);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(OracleTableExpr x) {
|
||||
x.getTable().accept(this);
|
||||
|
||||
@@ -972,11 +915,6 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OraclePrimaryKey astNode) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleAnalytic x) {
|
||||
|
||||
@@ -1127,11 +1065,6 @@ public class OracleOutputVisitor extends SQLASTOutputVisitor implements OracleAS
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleTableColumn x) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleTableExpr x) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user