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.statement.MySqlUpdateTableSource;
17 
18 import hunt.sql.ast.statement.SQLTableSourceImpl;
19 import hunt.sql.dialect.mysql.visitor.MySqlASTVisitor;
20 import hunt.sql.visitor.SQLASTVisitor;
21 import hunt.sql.dialect.mysql.ast.statement.MySqlUpdateStatement;
22 
23 public class MySqlUpdateTableSource : SQLTableSourceImpl {
24 
25     private MySqlUpdateStatement update;
26 
27     public this(MySqlUpdateStatement update){
28         this.update = update;
29     }
30 
31     
32     override  protected void accept0(SQLASTVisitor visitor) {
33         if (cast(MySqlASTVisitor)(visitor) !is null) {
34             accept0(cast(MySqlASTVisitor) visitor);
35         } else {
36             throw new Exception("not support visitor type : " ~ typeof(visitor).stringof);
37         }
38     }
39 
40     public void accept0(MySqlASTVisitor visitor) {
41         if (visitor.visit(this)) {
42             acceptChild(visitor, update);
43         }
44         visitor.endVisit(this);
45     }
46 
47     public MySqlUpdateStatement getUpdate() {
48         return update;
49     }
50 
51     public void setUpdate(MySqlUpdateStatement update) {
52         this.update = update;
53     }
54 
55 }