001package gudusoft.gsqlparser.nodes;
002
003import gudusoft.gsqlparser.EDbObjectType;
004import gudusoft.gsqlparser.EIndexType;
005import gudusoft.gsqlparser.EKeyReferenceType;
006import gudusoft.gsqlparser.TBaseType;
007import gudusoft.gsqlparser.TSourceToken;
008import gudusoft.gsqlparser.nodes.couchbase.TKeyspaceRef;
009
010public class TDropIndexSqlNode extends TParseTreeNode {
011
012    public TObjectNameList getIndexNameList() {
013        return indexNameList;
014    }
015
016    private TObjectNameList indexNameList;
017    private TObjectName tableName;
018
019    public TObjectName getIndexName() {
020        return indexName;
021    }
022
023    private TObjectName indexName = null;
024    private TDropIndexItemList dropIndexItemList = null;
025
026    public TDropIndexItemList getDropIndexItemList() {
027        return dropIndexItemList;
028    }
029
030    public void init(Object arg1)
031    {
032        if (arg1 instanceof TObjectName){
033           indexName = (TObjectName)arg1;
034           //indexName.setObjectType(TObjectName.ttobjIndexName);
035           indexName.setDbObjectType(EDbObjectType.index);
036        }else if (arg1 instanceof TDropIndexItemList){
037            this.dropIndexItemList = (TDropIndexItemList)arg1;
038        }else if (arg1 instanceof TObjectNameList){
039            indexNameList = (TObjectNameList)arg1;
040        }
041    }
042
043    private EKeyReferenceType dropRestrictType = EKeyReferenceType.no_action;
044
045    public EKeyReferenceType getDropRestrictType() {
046        return dropRestrictType;
047
048    }
049
050    public void setDropRestrictType(TSourceToken st) {
051        if (st == null) return;
052
053        if (st.tokencode == TBaseType.rrw_cascade ){
054            this.dropRestrictType = EKeyReferenceType.cascade;
055        }else if (st.tokencode == TBaseType.rrw_restrict){
056            this.dropRestrictType = EKeyReferenceType.restrict;
057        }
058
059    }
060
061    public TObjectName getTableName() {
062        return tableName;
063    }
064
065    public void init(Object arg1,Object arg2){
066        init(arg1);
067        tableName = (TObjectName)arg2;
068    }
069
070    private TKeyspaceRef keyspaceRef;
071
072    public void setKeyspaceRef(TKeyspaceRef keyspaceRef) {
073        this.keyspaceRef = keyspaceRef;
074    }
075
076    public TKeyspaceRef getKeyspaceRef() {
077
078        return keyspaceRef;
079    }
080
081    private EIndexType indexType;
082
083    public void setIndexType(EIndexType indexType) {
084        this.indexType = indexType;
085    }
086
087    public EIndexType getIndexType() {
088
089        return indexType;
090    }
091}