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.SQLAlterTableExchangePartition;
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 import hunt.sql.ast.statement.SQLExprTableSource;
23 import hunt.Boolean;
24 
25 public class SQLAlterTableExchangePartition : SQLObjectImpl , SQLAlterTableItem {
26     private SQLName partition;
27     private SQLExprTableSource table;
28     private bool validation;
29 
30     public this() {
31 
32     }
33 
34     override  protected void accept0(SQLASTVisitor visitor) {
35         if (visitor.visit(this)) {
36             acceptChild(visitor, partition);
37             acceptChild(visitor, table);
38         }
39         visitor.endVisit(this);
40     }
41 
42     public SQLName getPartition() {
43         return partition;
44     }
45 
46     public void setPartition(SQLName x) {
47         if (x !is null) {
48             x.setParent(this);
49         }
50         this.partition = x;
51     }
52 
53     public SQLExprTableSource getTable() {
54         return table;
55     }
56 
57     public void setTable(SQLName x) {
58         setTable(new SQLExprTableSource(x));
59     }
60 
61     public void setTable(SQLExprTableSource x) {
62         if (x !is null) {
63             x.setParent(this);
64         }
65         this.table = x;
66     }
67 
68     public void setValidation(bool validation) {
69         this.validation = validation;
70     }
71 
72     public Boolean getValidation() {
73         return new Boolean(validation);
74     }
75 }