1 /*
2 * Copyright 2015-2018 HuntLabs.cn
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */16 modulehunt.sql.ast.statement.SQLAlterTableDropColumnItem;
17 18 importhunt.collection;
19 20 importhunt.sql.ast.SQLName;
21 importhunt.sql.ast.SQLObjectImpl;
22 importhunt.sql.visitor.SQLASTVisitor;
23 importhunt.sql.ast.statement.SQLAlterTableItem;
24 importhunt.sql.ast.SQLObject;
25 26 publicclassSQLAlterTableDropColumnItem : SQLObjectImpl , SQLAlterTableItem {
27 28 privateList!SQLNamecolumns;
29 30 privateboolcascade = false;
31 32 publicthis(){
33 columns = newArrayList!SQLName();
34 }
35 36 overrideprotectedvoidaccept0(SQLASTVisitorvisitor) {
37 if (visitor.visit(this)) {
38 acceptChild!SQLName(visitor, columns);
39 }
40 visitor.endVisit(this);
41 }
42 43 publicList!SQLNamegetColumns() {
44 returncolumns;
45 }
46 47 publicvoidaddColumn(SQLNamecolumn) {
48 if (column !isnull) {
49 column.setParent(this);
50 }
51 this.columns.add(column);
52 }
53 54 publicboolisCascade() {
55 returncascade;
56 }
57 58 publicvoidsetCascade(boolcascade) {
59 this.cascade = cascade;
60 }
61 62 }