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

import com.chenyang.druid.DbType;
import com.chenyang.druid.sql.ast.statement.SQLUpdateStatement;
import com.chenyang.druid.sql.dialect.greenplum.visitor.GPASTVisitor;
import com.chenyang.druid.sql.visitor.SQLASTVisitor;

public class GPUpdateStatement extends SQLUpdateStatement implements GPSQLStatement {
   private boolean only = false;

   public GPUpdateStatement() {
      super(DbType.greenplum);
   }

   public boolean isOnly() {
      return this.only;
   }

   public void setOnly(boolean only) {
      this.only = only;
   }

   protected void accept0(SQLASTVisitor visitor) {
      if (visitor instanceof GPASTVisitor) {
         this.accept0((GPASTVisitor)visitor);
      } else {
         super.accept0(visitor);
      }
   }

   public void accept0(GPASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.acceptChild(visitor);
      }

      visitor.endVisit(this);
   }
}
