package com.chenyang.druid.sql.dialect.dm.ast.stmt;

import com.chenyang.druid.sql.ast.SQLExpr;
import com.chenyang.druid.sql.ast.statement.SQLConstraint;
import com.chenyang.druid.sql.ast.statement.SQLPrimaryKey;
import com.chenyang.druid.sql.ast.statement.SQLTableConstraint;
import com.chenyang.druid.sql.ast.statement.SQLTableElement;
import com.chenyang.druid.sql.ast.statement.SQLUnique;
import com.chenyang.druid.sql.dialect.dm.ast.DMSQLObject;
import com.chenyang.druid.sql.dialect.dm.visitor.DmASTVisitor;
import com.chenyang.druid.sql.visitor.SQLASTOutputVisitor;
import com.chenyang.druid.sql.visitor.SQLASTVisitor;

public class DmSQLUniqueKey extends SQLUnique implements SQLConstraint, SQLPrimaryKey, SQLTableElement, SQLTableConstraint, DMSQLObject {
   protected Boolean clustered;
   protected Boolean unique;
   protected Boolean key;
   private SQLExpr tablespacename;

   protected void accept0(SQLASTVisitor v) {
      if (v instanceof DmASTVisitor) {
         this.accept0((DmASTVisitor)v);
      } else {
         if (v instanceof SQLASTOutputVisitor) {
            ((SQLASTOutputVisitor)v).print(this.toString());
         }

      }
   }

   public void accept0(DmASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.acceptChild(visitor, this.getName());
      }

      visitor.endVisit(this);
   }

   public SQLExpr getTablespacename() {
      return this.tablespacename;
   }

   public void setTablespacename(SQLExpr tablespacename) {
      this.tablespacename = tablespacename;
   }

   public Boolean getClustered() {
      return this.clustered;
   }

   public void setClustered(Boolean clustered) {
      this.clustered = clustered;
   }

   public Boolean getUnique() {
      return this.unique;
   }

   public void setUnique(Boolean unique) {
      this.unique = unique;
   }

   public Boolean getKey() {
      return this.key;
   }

   public void setKey(Boolean key) {
      this.key = key;
   }
}
