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.dialect.mysql.ast.statement.MySqlAlterTableChangeColumn;
17 
18 import hunt.sql.ast.SQLExpr;
19 import hunt.sql.ast.SQLName;
20 import hunt.sql.ast.statement.SQLAlterTableItem;
21 import hunt.sql.ast.statement.SQLColumnDefinition;
22 import hunt.sql.dialect.mysql.ast.MySqlObjectImpl;
23 import hunt.sql.dialect.mysql.visitor.MySqlASTVisitor;
24 
25 public class MySqlAlterTableChangeColumn : MySqlObjectImpl , SQLAlterTableItem {
26 
27     alias accept0 = MySqlObjectImpl.accept0;
28     
29     private SQLName             columnName;
30 
31     private SQLColumnDefinition newColumnDefinition;
32 
33     private bool             first;
34 
35     private SQLName             firstColumn;
36     private SQLName             afterColumn;
37 
38     override
39     public void accept0(MySqlASTVisitor visitor) {
40         if (visitor.visit(this)) {
41             acceptChild(visitor, columnName);
42             acceptChild(visitor, newColumnDefinition);
43 
44             acceptChild(visitor, firstColumn);
45             acceptChild(visitor, afterColumn);
46         }
47     }
48 
49     public SQLName getFirstColumn() {
50         return firstColumn;
51     }
52 
53     public void setFirstColumn(SQLName firstColumn) {
54         this.firstColumn = firstColumn;
55     }
56 
57     public SQLName getAfterColumn() {
58         return afterColumn;
59     }
60 
61     public void setAfterColumn(SQLName afterColumn) {
62         this.afterColumn = afterColumn;
63     }
64 
65     public SQLName getColumnName() {
66         return columnName;
67     }
68 
69     public void setColumnName(SQLName columnName) {
70         this.columnName = columnName;
71     }
72 
73     public SQLColumnDefinition getNewColumnDefinition() {
74         return newColumnDefinition;
75     }
76 
77     public void setNewColumnDefinition(SQLColumnDefinition newColumnDefinition) {
78         this.newColumnDefinition = newColumnDefinition;
79     }
80 
81     public bool isFirst() {
82         return first;
83     }
84 
85     public void setFirst(bool first) {
86         this.first = first;
87     }
88 
89 }