package com.chenyang.druid.sql.ast;

import com.chenyang.druid.sql.ast.statement.SQLCreateTableStatement;
import com.chenyang.druid.sql.ast.statement.SQLTableSourceImpl;
import com.chenyang.druid.sql.visitor.SQLASTVisitor;

public class SQLAdhocTableSource extends SQLTableSourceImpl {
   private SQLCreateTableStatement definition;

   public SQLAdhocTableSource(SQLCreateTableStatement definition) {
      this.setDefinition(definition);
   }

   protected void accept0(SQLASTVisitor v) {
      if (v.visit(this) && this.definition != null) {
         this.definition.accept(v);
      }

      v.endVisit(this);
   }

   public SQLCreateTableStatement getDefinition() {
      return this.definition;
   }

   public void setDefinition(SQLCreateTableStatement x) {
      if (x != null) {
         x.setParent(this);
      }

      this.definition = x;
   }
}
