1 module hunt.sql.ast.statement.SQLDropTriggerStatement; 2 3 /* 4 * Copyright 2015-2018 HuntLabs.cn 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 import hunt.sql.ast.SQLName; 19 import hunt.sql.ast.SQLObject; 20 import hunt.sql.ast.SQLStatementImpl; 21 import hunt.sql.visitor.SQLASTVisitor; 22 import hunt.sql.ast.statement.SQLDropStatement; 23 24 25 import hunt.collection; 26 27 public class SQLDropTriggerStatement : SQLStatementImpl , SQLDropStatement { 28 29 private SQLName name; 30 private bool ifExists; 31 32 public this() { 33 34 } 35 36 public this(string dbType) { 37 super (dbType); 38 } 39 40 public SQLName getName() { 41 return name; 42 } 43 44 public void setName(SQLName name) { 45 this.name = name; 46 } 47 48 49 override protected void accept0(SQLASTVisitor visitor) { 50 if (visitor.visit(this)) { 51 acceptChild(visitor, name); 52 } 53 visitor.endVisit(this); 54 } 55 56 override 57 public List!SQLObject getChildren() { 58 List!SQLObject children = new ArrayList!SQLObject(); 59 if (name !is null) { 60 children.add(name); 61 } 62 return children; 63 } 64 65 public bool isIfExists() { 66 return ifExists; 67 } 68 69 public void setIfExists(bool ifExists) { 70 this.ifExists = ifExists; 71 } 72 }