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

import com.chenyang.druid.DbType;
import com.chenyang.druid.sql.ast.SQLName;
import com.chenyang.druid.sql.ast.statement.SQLCreateStatement;
import com.chenyang.druid.sql.dialect.dm.visitor.DmASTVisitor;

public class DmCreateSynonymStatement extends DmStatementImpl implements SQLCreateStatement {
   private boolean orReplace;
   private SQLName name;
   private boolean isPublic;
   private SQLName object;

   public DmCreateSynonymStatement() {
      this.dbType = DbType.dm;
   }

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

      visitor.endVisit(this);
   }

   public boolean isPublic() {
      return this.isPublic;
   }

   public void setPublic(boolean value) {
      this.isPublic = value;
   }

   public SQLName getName() {
      return this.name;
   }

   public void setName(SQLName name) {
      if (name != null) {
         name.setParent(this);
      }

      this.name = name;
   }

   public SQLName getObject() {
      return this.object;
   }

   public void setObject(SQLName object) {
      if (object != null) {
         object.setParent(this);
      }

      this.object = object;
   }

   public boolean isOrReplace() {
      return this.orReplace;
   }

   public void setOrReplace(boolean orReplace) {
      this.orReplace = orReplace;
   }
}
