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.SQLAlterTableDropPartition; 17 18 import hunt.collection; 19 20 import hunt.sql.ast.SQLObject; 21 import hunt.sql.ast.SQLObjectImpl; 22 import hunt.sql.visitor.SQLASTVisitor; 23 import hunt.sql.ast.statement.SQLAlterTableItem; 24 25 public class SQLAlterTableDropPartition : SQLObjectImpl , SQLAlterTableItem { 26 27 private bool ifExists = false; 28 29 private bool purge; 30 31 private List!SQLObject partitions; 32 this() 33 { 34 partitions = new ArrayList!SQLObject(4); 35 } 36 37 public List!SQLObject getPartitions() { 38 return partitions; 39 } 40 41 public void addPartition(SQLObject partition) { 42 if (partition !is null) { 43 partition.setParent(this); 44 } 45 this.partitions.add(partition); 46 } 47 48 public bool isIfExists() { 49 return ifExists; 50 } 51 52 public void setIfExists(bool ifExists) { 53 this.ifExists = ifExists; 54 } 55 56 public bool isPurge() { 57 return purge; 58 } 59 60 public void setPurge(bool purge) { 61 this.purge = purge; 62 } 63 64 override protected void accept0(SQLASTVisitor visitor) { 65 if (visitor.visit(this)) { 66 acceptChild(visitor, partitions); 67 } 68 visitor.endVisit(this); 69 } 70 }