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.SQLRollbackStatement;
17
18 import hunt.sql.ast.SQLExpr;
19 import hunt.sql.ast.SQLName;
20 import hunt.sql.ast.SQLObject;
21 import hunt.sql.ast.SQLStatementImpl;
22 import hunt.sql.visitor.SQLASTVisitor;
23 import hunt.Boolean;
24
25 import hunt.collection;
26
27 public class SQLRollbackStatement : SQLStatementImpl {
28
29 private SQLName to;
30
31 // for mysql
32 private Boolean chain;
33 private Boolean release;
34 private SQLExpr force;
35
36 public this() {
37
38 }
39
40 public this(string dbType) {
41 super (dbType);
42 }
43
44
45 override protected void accept0(SQLASTVisitor visitor) {
46 if (visitor.visit(this)) {
47 acceptChild(visitor, to);
48
49 acceptChild(visitor, force);
50 }
51 visitor.endVisit(this);
52 }
53
54 override
55 public List!SQLObject getChildren() {
56 List!SQLObject children = new ArrayList!SQLObject();
57 if (to !is null) {
58 children.add(to);
59 }
60 if (force !is null) {
61 children.add(force);
62 }
63 return children;
64 }
65
66 public SQLName getTo() {
67 return to;
68 }
69
70 public void setTo(SQLName to) {
71 this.to = to;
72 }
73
74 public Boolean getChain() {
75 return chain;
76 }
77
78 public void setChain(Boolean chain) {
79 this.chain = chain;
80 }
81
82 public Boolean getRelease() {
83 return release;
84 }
85
86 public void setRelease(Boolean release) {
87 this.release = release;
88 }
89
90 public SQLExpr getForce() {
91 return force;
92 }
93
94 public void setForce(SQLExpr force) {
95 this.force = force;
96 }
97
98 }