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.SQLAlterTableRenamePartition; 17 18 import hunt.collection; 19 20 import hunt.sql.ast.SQLObjectImpl; 21 import hunt.sql.visitor.SQLASTVisitor; 22 import hunt.sql.ast.statement.SQLAlterTableItem; 23 import hunt.sql.ast.statement.SQLAssignItem; 24 import hunt.sql.ast.SQLObject; 25 26 public class SQLAlterTableRenamePartition : SQLObjectImpl , SQLAlterTableItem { 27 28 private bool ifNotExists = false; 29 30 private List!SQLAssignItem partition; 31 private List!SQLAssignItem to; 32 33 this() 34 { 35 partition = new ArrayList!SQLAssignItem(4); 36 to = new ArrayList!SQLAssignItem(4); 37 } 38 39 public List!SQLAssignItem getPartition() { 40 return partition; 41 } 42 43 public bool isIfNotExists() { 44 return ifNotExists; 45 } 46 47 public void setIfNotExists(bool ifNotExists) { 48 this.ifNotExists = ifNotExists; 49 } 50 51 public List!SQLAssignItem getTo() { 52 return to; 53 } 54 55 override protected void accept0(SQLASTVisitor visitor) { 56 if (visitor.visit(this)) { 57 acceptChild!SQLAssignItem(visitor, partition); 58 acceptChild!SQLAssignItem(visitor, to); 59 } 60 visitor.endVisit(this); 61 } 62 }