001package gudusoft.gsqlparser.nodes.oceanbase;
002
003import gudusoft.gsqlparser.EDbObjectType;
004import gudusoft.gsqlparser.nodes.TObjectName;
005import gudusoft.gsqlparser.nodes.TParseTreeNode;
006import gudusoft.gsqlparser.nodes.TParseTreeVisitor;
007
008/**
009 * AST node for OceanBase {@code ALTER OUTLINE} (Phase 4 Batch 8).
010 *
011 * <p>Grammar shape: {@code ALTER OUTLINE name {ENABLE | DISABLE}}.
012 *
013 * @since 4.0.1.4
014 */
015public class TOceanbaseAlterOutlineSqlNode extends TParseTreeNode {
016
017    public enum EAction {
018        ENABLE,
019        DISABLE
020    }
021
022    private TObjectName outlineName;
023    private EAction actionType;
024
025    public TObjectName getOutlineName() {
026        return outlineName;
027    }
028
029    public void setOutlineName(TObjectName outlineName) {
030        this.outlineName = outlineName;
031        if (outlineName != null) {
032            outlineName.setDbObjectType(EDbObjectType.database);
033        }
034    }
035
036    public EAction getActionType() {
037        return actionType;
038    }
039
040    public void setActionType(EAction actionType) {
041        this.actionType = actionType;
042    }
043
044    @Override
045    public void init(Object arg1) {
046        setOutlineName((TObjectName) arg1);
047    }
048
049    @Override
050    public void accept(TParseTreeVisitor v) {
051        v.preVisit(this);
052        v.postVisit(this);
053    }
054
055    @Override
056    public void acceptChildren(TParseTreeVisitor v) {
057        v.preVisit(this);
058        if (outlineName != null) outlineName.acceptChildren(v);
059        v.postVisit(this);
060    }
061}