001package gudusoft.gsqlparser.stmt.couchbase;
002
003import gudusoft.gsqlparser.*;
004import gudusoft.gsqlparser.nodes.TObjectNameList;
005import gudusoft.gsqlparser.nodes.TParseTreeVisitor;
006import gudusoft.gsqlparser.nodes.couchbase.TBuildIndexesSqlNode;
007import gudusoft.gsqlparser.nodes.couchbase.TKeyspaceRef;
008
009
010
011public class TTBuildIndexesStmt extends TCustomSqlStatement {
012    private TKeyspaceRef keyspaceRef;
013    private TObjectNameList indexNames;
014    private EIndexType indexType;
015
016    public TTBuildIndexesStmt(EDbVendor dbvendor) {
017        super(dbvendor);
018        sqlstatementtype = ESqlStatementType.sstBuildIndex;
019    }
020
021    public TKeyspaceRef getKeyspaceRef() {
022        return keyspaceRef;
023    }
024
025    public TObjectNameList getIndexNames() {
026        return indexNames;
027    }
028
029    public EIndexType getIndexType() {
030        return indexType;
031    }
032
033    public int doParseStatement(TCustomSqlStatement psql) {
034        if (rootNode == null) return -1;
035        super.doParseStatement(psql);
036        TBuildIndexesSqlNode node = (TBuildIndexesSqlNode)(rootNode);
037        keyspaceRef = node.getKeyspaceRef();
038        indexNames = node.getIndexNames();
039        indexType = node.getIndexType();
040
041
042
043        return 0;
044    }
045
046    public void accept(TParseTreeVisitor v){
047        v.preVisit(this);
048        v.postVisit(this);
049    }
050
051    public void acceptChildren(TParseTreeVisitor v){
052        v.preVisit(this);
053        v.postVisit(this);
054    }
055}
056