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.expr.SQLAllColumnExpr;
17 
18 import hunt.sql.ast.SQLExprImpl;
19 import hunt.sql.ast.statement.SQLTableSource;
20 import hunt.sql.visitor.SQLASTVisitor;
21 import hunt.collection;
22 import hunt.sql.ast.SQLObject;
23 import hunt.util.StringBuilder;
24 
25 public  class SQLAllColumnExpr : SQLExprImpl {
26     private  SQLTableSource resolvedTableSource;
27 
28     public this(){
29 
30     }
31 
32     override public void output(StringBuilder buf) {
33         buf.append("*");
34     }
35 
36     override  protected void accept0(SQLASTVisitor visitor) {
37         visitor.visit(this);
38         visitor.endVisit(this);
39     }
40 
41     override public size_t toHash() @trusted nothrow {
42         return 0;
43     }
44 
45     override public bool opEquals(Object o) {
46         return cast(SQLAllColumnExpr)o is null ? false : true;
47     }
48 
49     override public SQLAllColumnExpr clone() {
50         SQLAllColumnExpr x = new SQLAllColumnExpr();
51 
52         x.resolvedTableSource = resolvedTableSource;
53         return x;
54     }
55 
56     public SQLTableSource getResolvedTableSource() {
57         return resolvedTableSource;
58     }
59 
60     public void setResolvedTableSource(SQLTableSource resolvedTableSource) {
61         this.resolvedTableSource = resolvedTableSource;
62     }
63 
64    override
65     public List!SQLObject getChildren() {
66         return Collections.emptyList!(SQLObject)();
67     }
68 }