1 module hunt.sql.ast.SQLArrayDataType;
2 
3 
4 import hunt.sql.ast.SQLObjectImpl;
5 import hunt.sql.ast.SQLExpr;
6 import hunt.sql.ast.SQLDataType;
7 import hunt.sql.visitor.SQLASTVisitor;
8 import hunt.sql.util.FnvHash;
9 
10 import hunt.Boolean;
11 import hunt.collection;
12 
13 
14 public class SQLArrayDataType : SQLObjectImpl , SQLDataType {
15     private string dbType;
16     private SQLDataType componentType;
17 
18     public this(SQLDataType componentType) {
19         setComponentType(componentType);
20     }
21 
22     public this(SQLDataType componentType, string dbType) {
23         this.dbType = dbType;
24         setComponentType(componentType);
25     }
26 
27     public string getName() {
28         return "ARRAY";
29     }
30 
31     public long nameHashCode64() {
32         return FnvHash.Constants.ARRAY;
33     }
34 
35     public void setName(string name) {
36         throw new Exception("UnsupportedOperation");
37     }
38 
39     public List!SQLExpr getArguments() {
40         return new ArrayList!SQLExpr();
41     }
42 
43     public Boolean getWithTimeZone() {
44         return Boolean.FALSE;
45     }
46 
47     public void setWithTimeZone(Boolean value) {
48         throw new Exception("UnsupportedOperation");
49     }
50 
51     public bool isWithLocalTimeZone() {
52         return false;
53     }
54 
55     public void setWithLocalTimeZone(bool value) {
56         throw new Exception("UnsupportedOperation");
57     }
58 
59     public void setDbType(string dbType) {
60         dbType = dbType;
61     }
62 
63     public string getDbType() {
64         return dbType;
65     }
66 
67     
68     protected override void accept0(SQLASTVisitor visitor) {
69         if (visitor.visit(this)) {
70             acceptChild(visitor, componentType);
71         }
72         visitor.endVisit(this);
73     }
74 
75     public override SQLArrayDataType clone() {
76         return null;
77     }
78 
79     public SQLDataType getComponentType() {
80         return componentType;
81     }
82 
83     public void setComponentType(SQLDataType x) {
84         if (x !is null) {
85             x.setParent(this);
86         }
87         this.componentType = x;
88     }
89 }