1 module hunt.sql.ast.SQLKeep;
2 
3 import hunt.sql.ast.SQLObject;
4 import hunt.sql.ast.SQLObjectImpl;
5 import hunt.sql.ast.SQLOrderBy;
6 import hunt.sql.visitor.SQLASTVisitor;
7 
8 
9 public  class SQLKeep : SQLObjectImpl {
10 
11     protected DenseRank  denseRank;
12 
13     protected SQLOrderBy orderBy;
14 
15     protected override void accept0(SQLASTVisitor visitor) {
16         if (visitor.visit(this)) {
17             acceptChild(visitor, this.orderBy);
18         }
19         visitor.endVisit(this);
20     }
21 
22     public DenseRank getDenseRank() {
23         return denseRank;
24     }
25 
26     public void setDenseRank(DenseRank denseRank) {
27         this.denseRank = denseRank;
28     }
29 
30     public SQLOrderBy getOrderBy() {
31         return orderBy;
32     }
33 
34     public void setOrderBy(SQLOrderBy orderBy) {
35         if (orderBy !is null) {
36             orderBy.setParent(this);
37         }
38         this.orderBy = orderBy;
39     }
40 
41 
42     public override SQLKeep clone() {
43         SQLKeep x = new SQLKeep();
44 
45         x.denseRank = denseRank;
46 
47         if (orderBy !is null) {
48             x.setOrderBy(orderBy.clone());
49         }
50 
51         return x;
52     }
53 
54     public static enum DenseRank {
55                                   FIRST, //
56                                   LAST
57     }
58 }