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.SQLShowTablesStatement; 17 18 import hunt.sql.ast.SQLExpr; 19 import hunt.sql.ast.SQLName; 20 import hunt.sql.ast.SQLStatementImpl; 21 import hunt.sql.visitor.SQLASTVisitor; 22 23 public class SQLShowTablesStatement : SQLStatementImpl { 24 25 protected SQLName database; 26 protected SQLExpr like; 27 28 // for mysql 29 protected bool full; 30 protected SQLExpr where; 31 32 public SQLName getDatabase() { 33 return database; 34 } 35 36 public void setDatabase(SQLName database) { 37 if (database !is null) { 38 database.setParent(this); 39 } 40 41 this.database = database; 42 } 43 44 public SQLExpr getLike() { 45 return like; 46 } 47 48 public void setLike(SQLExpr like) { 49 if (like !is null) { 50 like.setParent(this); 51 } 52 53 this.like = like; 54 } 55 56 public bool isFull() { 57 return full; 58 } 59 60 public void setFull(bool full) { 61 this.full = full; 62 } 63 64 public SQLExpr getWhere() { 65 return where; 66 } 67 68 public void setWhere(SQLExpr where) { 69 this.where = where; 70 } 71 72 73 override protected void accept0(SQLASTVisitor visitor) { 74 if (visitor.visit(this)) { 75 acceptChild(visitor, database); 76 acceptChild(visitor, like); 77 } 78 } 79 }