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.dialect.mysql.ast.clause.MySqlRepeatStatement; 17 18 19 import hunt.collection; 20 import hunt.sql.ast.SQLObject; 21 22 import hunt.sql.ast.SQLExpr; 23 import hunt.sql.ast.SQLStatement; 24 import hunt.sql.dialect.mysql.ast.statement.MySqlStatementImpl; 25 import hunt.sql.dialect.mysql.visitor.MySqlASTVisitor; 26 27 28 public class MySqlRepeatStatement : MySqlStatementImpl { 29 30 alias accept0 = MySqlStatementImpl.accept0; 31 32 private string labelName; 33 34 private List!(SQLStatement) statements; 35 36 private SQLExpr condition; 37 38 this() 39 { 40 statements = new ArrayList!(SQLStatement)(); 41 } 42 43 override 44 public void accept0(MySqlASTVisitor visitor) { 45 if (visitor.visit(this)) { 46 acceptChild!SQLStatement(visitor, statements); 47 acceptChild(visitor, condition); 48 } 49 visitor.endVisit(this); 50 } 51 52 public List!(SQLStatement) getStatements() { 53 return statements; 54 } 55 56 public void setStatements(List!(SQLStatement) statements) { 57 this.statements = statements; 58 } 59 60 public string getLabelName() { 61 return labelName; 62 } 63 64 public void setLabelName(string labelName) { 65 this.labelName = labelName; 66 } 67 68 public SQLExpr getCondition() { 69 return condition; 70 } 71 72 public void setCondition(SQLExpr condition) { 73 this.condition = condition; 74 } 75 }