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

import com.alibaba.druid.sql.ast.statement.SQLForeignKeyImpl;
import com.alibaba.druid.sql.dialect.dm.ast.DMSQLObject;
import com.alibaba.druid.sql.dialect.dm.visitor.DmASTVisitor;
import com.alibaba.druid.sql.visitor.SQLASTOutputVisitor;
import com.alibaba.druid.sql.visitor.SQLASTVisitor;

public class DmForeignKeyImpl extends SQLForeignKeyImpl implements DMSQLObject {
   private Boolean pendant;
   private Boolean withIndex;
   private Match referenceMatch;
   protected Option onUpdate;
   protected Option onDelete;

   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 Boolean getPendant() {
      return this.pendant;
   }

   public void setPendant(Boolean pendant) {
      this.pendant = pendant;
   }

   public Boolean getWithIndex() {
      return this.withIndex;
   }

   public void setWithIndex(Boolean withIndex) {
      this.withIndex = withIndex;
   }

   public Match getReferenceMatch() {
      return this.referenceMatch;
   }

   public void setReferenceMatch(Match referenceMatch) {
      this.referenceMatch = referenceMatch;
   }

   public Option getOnUpdate() {
      return this.onUpdate;
   }

   public void setOnUpdate(Option onUpdate) {
      this.onUpdate = onUpdate;
   }

   public Option getOnDelete() {
      return this.onDelete;
   }

   public void setOnDelete(Option onDelete) {
      this.onDelete = onDelete;
   }
}
