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

import com.chenyang.druid.DbType;
import com.chenyang.druid.sql.ast.SQLExpr;
import com.chenyang.druid.sql.ast.SQLStatement;
import com.chenyang.druid.sql.ast.SQLStatementImpl;
import com.chenyang.druid.sql.ast.expr.SQLIdentifierExpr;
import com.chenyang.druid.sql.ast.statement.SQLCreateStatement;
import com.chenyang.druid.sql.dialect.db2.visitor.DB2ASTVisitor;
import com.chenyang.druid.sql.visitor.SQLASTVisitor;
import java.util.ArrayList;
import java.util.List;

public class DB2CreateSchemaStatement extends SQLStatementImpl implements DB2SQLStatement, SQLCreateStatement {
   private SQLExpr schemaName;
   private SQLIdentifierExpr userName;
   private boolean authorization;
   private boolean path;
   private SQLExpr schemaPath;
   private boolean dataVersionRetentionTime;
   private SQLExpr dataVersionRetentionTimeNum;
   private List<SQLStatement> elements = new ArrayList();

   public DB2CreateSchemaStatement() {
      this.dbType = DbType.db2;
   }

   public SQLExpr getSchemaName() {
      return this.schemaName;
   }

   public void addElement(SQLStatement e) {
      e.setParent(this);
      this.elements.add(e);
   }

   public List<SQLStatement> getElements() {
      return this.elements;
   }

   public void setElements(List<SQLStatement> elements) {
      this.elements = elements;
   }

   public void setSchemaName(SQLExpr schemaName) {
      this.schemaName = schemaName;
      schemaName.setParent(this);
   }

   public SQLIdentifierExpr getUserName() {
      return this.userName;
   }

   public void setUserName(SQLIdentifierExpr userName) {
      this.userName = userName;
      userName.setParent(this);
   }

   public boolean isPath() {
      return this.path;
   }

   public void setPath(boolean path) {
      this.path = path;
   }

   public SQLExpr getSchemaPath() {
      return this.schemaPath;
   }

   public void setSchemaPath(SQLExpr schemaPath) {
      this.schemaPath = schemaPath;
   }

   public boolean isDataVersionRetentionTime() {
      return this.dataVersionRetentionTime;
   }

   public void setDataVersionRetentionTime(boolean dataVersionRetentionTime) {
      this.dataVersionRetentionTime = dataVersionRetentionTime;
   }

   public SQLExpr getDataVersionRetentionTimeNum() {
      return this.dataVersionRetentionTimeNum;
   }

   public void setDataVersionRetentionTimeNum(SQLExpr dataVersionRetentionTimeNum) {
      this.dataVersionRetentionTimeNum = dataVersionRetentionTimeNum;
   }

   public boolean isAuthorization() {
      return this.authorization;
   }

   public void setAuthorization(boolean authorization) {
      this.authorization = authorization;
   }

   protected void accept0(SQLASTVisitor visitor) {
      this.accept0((DB2ASTVisitor)visitor);
   }

   public void accept0(DB2ASTVisitor visitor) {
      if (visitor.visit(this)) {
         this.acceptChild(visitor, this.schemaName);
         this.acceptChild(visitor, this.userName);
         this.acceptChild(visitor, this.elements);
      }

      visitor.endVisit(this);
   }
}
