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.MySqlDeclareHandlerStatement; 17 18 19 import hunt.collection; 20 21 import hunt.sql.ast.SQLStatement; 22 import hunt.sql.dialect.mysql.ast.statement.MySqlStatementImpl; 23 import hunt.sql.dialect.mysql.visitor.MySqlASTVisitor; 24 import hunt.sql.dialect.mysql.ast.clause.ConditionValue; 25 import hunt.sql.dialect.mysql.ast.clause.MySqlHandlerType; 26 27 28 public class MySqlDeclareHandlerStatement : MySqlStatementImpl{ 29 30 alias accept0 = MySqlStatementImpl.accept0; 31 //DECLARE handler_type HANDLER FOR condition_value[,...] sp_statement 32 33 //handler type 34 private MySqlHandlerType handleType; 35 //sp statement 36 private SQLStatement spStatement; 37 38 private List!(ConditionValue) conditionValues; 39 40 41 public this() { 42 conditionValues = new ArrayList!(ConditionValue)(); 43 } 44 45 public List!(ConditionValue) getConditionValues() { 46 return conditionValues; 47 } 48 49 public void setConditionValues(List!(ConditionValue) conditionValues) { 50 this.conditionValues = conditionValues; 51 } 52 53 public MySqlHandlerType getHandleType() { 54 return handleType; 55 } 56 57 public void setHandleType(MySqlHandlerType handleType) { 58 this.handleType = handleType; 59 } 60 61 public SQLStatement getSpStatement() { 62 return spStatement; 63 } 64 65 public void setSpStatement(SQLStatement spStatement) { 66 this.spStatement = spStatement; 67 } 68 69 override 70 public void accept0(MySqlASTVisitor visitor) { 71 if (visitor.visit(this)) { 72 acceptChild(visitor, spStatement); 73 } 74 visitor.endVisit(this); 75 } 76 77 } 78