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 module hunt.sql.ast.statement.SQLAlterTableDropColumnItem;
17 
18 import hunt.collection;
19 
20 import hunt.sql.ast.SQLName;
21 import hunt.sql.ast.SQLObjectImpl;
22 import hunt.sql.visitor.SQLASTVisitor;
23 import hunt.sql.ast.statement.SQLAlterTableItem;
24 import hunt.sql.ast.SQLObject;
25 
26 public class SQLAlterTableDropColumnItem : SQLObjectImpl , SQLAlterTableItem {
27 
28     private List!SQLName columns;
29 
30     private bool       cascade = false;
31 
32     public this(){
33         columns = new ArrayList!SQLName();
34     }
35 
36     override  protected void accept0(SQLASTVisitor visitor) {
37         if (visitor.visit(this)) {
38             acceptChild!SQLName(visitor, columns);
39         }
40         visitor.endVisit(this);
41     }
42 
43     public List!SQLName getColumns() {
44         return columns;
45     }
46     
47     public void addColumn(SQLName column) {
48         if (column !is null) {
49             column.setParent(this);
50         }
51         this.columns.add(column);
52     }
53 
54     public bool isCascade() {
55         return cascade;
56     }
57 
58     public void setCascade(bool cascade) {
59         this.cascade = cascade;
60     }
61 
62 }