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.SQLAlterTableRenameColumn;
17 
18 import hunt.sql.ast.SQLName;
19 import hunt.sql.ast.SQLObjectImpl;
20 import hunt.sql.visitor.SQLASTVisitor;
21 import hunt.sql.ast.statement.SQLAlterTableItem;
22 
23 public class SQLAlterTableRenameColumn : SQLObjectImpl , SQLAlterTableItem {
24 
25     private SQLName column;
26     private SQLName to;
27 
28     public this(){
29 
30     }
31 
32     
33     override  protected void accept0(SQLASTVisitor visitor) {
34         if (visitor.visit(this)) {
35             acceptChild(visitor, column);
36             acceptChild(visitor, to);
37         }
38         visitor.endVisit(this);
39     }
40 
41     public SQLName getColumn() {
42         return column;
43     }
44 
45     public void setColumn(SQLName column) {
46         if (column !is null) {
47             column.setParent(this);
48         }
49         this.column = column;
50     }
51 
52     public SQLName getTo() {
53         return to;
54     }
55 
56     public void setTo(SQLName to) {
57         if (to !is null) {
58             to.setParent(this);
59         }
60         this.to = to;
61     }
62 
63 }