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.SQLRevokeStatement; 17 18 19 import hunt.collection; 20 21 import hunt.sql.ast.SQLExpr; 22 import hunt.sql.ast.SQLObject; 23 import hunt.sql.ast.SQLStatementImpl; 24 import hunt.sql.visitor.SQLASTVisitor; 25 import hunt.sql.ast.SQLObjectImpl; 26 import hunt.sql.ast.statement.SQLObjectType; 27 28 public class SQLRevokeStatement : SQLStatementImpl { 29 30 private List!SQLExpr privileges; 31 32 private SQLObject on; 33 private SQLExpr from; 34 // mysql 35 private SQLObjectType objectType; 36 37 public this(){ 38 privileges = new ArrayList!SQLExpr(); 39 } 40 41 public this(string dbType){ 42 privileges = new ArrayList!SQLExpr(); 43 super(dbType); 44 } 45 46 public SQLObject getOn() { 47 return on; 48 } 49 50 public void setOn(SQLObject on) { 51 this.on = on; 52 } 53 54 public SQLExpr getFrom() { 55 return from; 56 } 57 58 public void setFrom(SQLExpr from) { 59 this.from = from; 60 } 61 62 public List!SQLExpr getPrivileges() { 63 return privileges; 64 } 65 66 public SQLObjectType getObjectType() { 67 return objectType; 68 } 69 70 public void setObjectType(SQLObjectType objectType) { 71 this.objectType = objectType; 72 } 73 74 override protected void accept0(SQLASTVisitor visitor) { 75 if (visitor.visit(this)) { 76 acceptChild(visitor, on); 77 acceptChild(visitor, from); 78 } 79 visitor.endVisit(this); 80 } 81 }