package com.chenyang.druid.sql.dialect.sqlserver.visitor;

import com.chenyang.druid.DbType;
import com.chenyang.druid.sql.ast.statement.SQLInsertStatement;
import com.chenyang.druid.sql.ast.statement.SQLSelectQueryBlock;
import com.chenyang.druid.sql.dialect.sqlserver.ast.SQLServerOutput;
import com.chenyang.druid.sql.dialect.sqlserver.ast.SQLServerSelectQueryBlock;
import com.chenyang.druid.sql.dialect.sqlserver.ast.SQLServerTop;
import com.chenyang.druid.sql.dialect.sqlserver.ast.clause.SQLServerOver;
import com.chenyang.druid.sql.dialect.sqlserver.ast.expr.SQLServerCurrentOfCursorExpr;
import com.chenyang.druid.sql.dialect.sqlserver.ast.expr.SQLServerDateTimeExpr;
import com.chenyang.druid.sql.dialect.sqlserver.ast.expr.SQLServerObjectReferenceExpr;
import com.chenyang.druid.sql.dialect.sqlserver.ast.stmt.SQLServerDeleteStatement;
import com.chenyang.druid.sql.dialect.sqlserver.ast.stmt.SQLServerExecStatement;
import com.chenyang.druid.sql.dialect.sqlserver.ast.stmt.SQLServerInsertStatement;
import com.chenyang.druid.sql.dialect.sqlserver.ast.stmt.SQLServerMergeStatement;
import com.chenyang.druid.sql.dialect.sqlserver.ast.stmt.SQLServerRollbackStatement;
import com.chenyang.druid.sql.dialect.sqlserver.ast.stmt.SQLServerSelectPivot;
import com.chenyang.druid.sql.dialect.sqlserver.ast.stmt.SQLServerSelectSubqueryTableSource;
import com.chenyang.druid.sql.dialect.sqlserver.ast.stmt.SQLServerSelectTableReference;
import com.chenyang.druid.sql.dialect.sqlserver.ast.stmt.SQLServerSelectUnPivot;
import com.chenyang.druid.sql.dialect.sqlserver.ast.stmt.SQLServerSetTransactionIsolationLevelStatement;
import com.chenyang.druid.sql.dialect.sqlserver.ast.stmt.SQLServerUnionQueryTableSource;
import com.chenyang.druid.sql.dialect.sqlserver.ast.stmt.SQLServerUpdateSetItem;
import com.chenyang.druid.sql.dialect.sqlserver.ast.stmt.SQLServerUpdateStatement;
import com.chenyang.druid.sql.dialect.sqlserver.ast.stmt.SQLServerValuesTableSource;
import com.chenyang.druid.sql.dialect.sqlserver.ast.stmt.SQLServerWaitForStatement;
import com.chenyang.druid.sql.repository.SchemaRepository;
import com.chenyang.druid.sql.visitor.SchemaStatVisitor;
import com.chenyang.druid.stat.TableStat;

public class SQLServerSchemaStatVisitor extends SchemaStatVisitor implements SQLServerASTVisitor {
   public SQLServerSchemaStatVisitor() {
      super(DbType.sqlserver);
   }

   public SQLServerSchemaStatVisitor(SchemaRepository repository) {
      super(repository);
   }

   public boolean visit(SQLServerTop x) {
      return false;
   }

   public boolean visit(SQLServerObjectReferenceExpr x) {
      return false;
   }

   public boolean visit(SQLServerUpdateStatement x) {
      TableStat stat = this.getTableStat(x.getTableName());
      stat.incrementUpdateCount();
      this.accept(x.getItems());
      this.accept(x.getFrom());
      this.accept(x.getWhere());
      return false;
   }

   public boolean visit(SQLServerExecStatement x) {
      return false;
   }

   public boolean visit(SQLServerSetTransactionIsolationLevelStatement x) {
      return false;
   }

   public boolean visit(SQLServerOutput x) {
      return false;
   }

   public boolean visit(SQLServerRollbackStatement x) {
      return true;
   }

   public boolean visit(SQLServerWaitForStatement x) {
      return true;
   }

   public boolean visit(SQLServerExecStatement.SQLServerParameter x) {
      return false;
   }

   public boolean visit(SQLServerSelectQueryBlock x) {
      return this.visit((SQLSelectQueryBlock)x);
   }

   public void endVisit(SQLServerSelectQueryBlock x) {
      this.endVisit((SQLSelectQueryBlock)x);
   }

   public void endVisit(SQLServerTop x) {
   }

   public void endVisit(SQLServerObjectReferenceExpr x) {
   }

   public boolean visit(SQLServerInsertStatement x) {
      return this.visit((SQLInsertStatement)x);
   }

   public void endVisit(SQLServerInsertStatement x) {
      this.endVisit((SQLInsertStatement)x);
   }

   public void endVisit(SQLServerUpdateStatement x) {
   }

   public void endVisit(SQLServerExecStatement x) {
   }

   public void endVisit(SQLServerSetTransactionIsolationLevelStatement x) {
   }

   public void endVisit(SQLServerOutput x) {
   }

   public void endVisit(SQLServerRollbackStatement x) {
   }

   public void endVisit(SQLServerWaitForStatement x) {
   }

   public void endVisit(SQLServerExecStatement.SQLServerParameter x) {
   }

   public boolean visit(SQLServerUpdateSetItem x) {
      return true;
   }

   public void endVisit(SQLServerUpdateSetItem x) {
   }

   public boolean visit(SQLServerDeleteStatement x) {
      return true;
   }

   public void endVisit(SQLServerDeleteStatement x) {
   }

   public boolean visit(SQLServerDateTimeExpr x) {
      return true;
   }

   public void endVisit(SQLServerDateTimeExpr x) {
   }

   public boolean visit(SQLServerOver x) {
      return true;
   }

   public void endVisit(SQLServerOver x) {
   }

   public boolean visit(SQLServerSelectPivot x) {
      return true;
   }

   public void endVisit(SQLServerSelectPivot x) {
   }

   public boolean visit(SQLServerSelectUnPivot x) {
      return true;
   }

   public void endVisit(SQLServerSelectUnPivot x) {
   }

   public boolean visit(SQLServerSelectPivot.Item x) {
      return true;
   }

   public void endVisit(SQLServerSelectPivot.Item x) {
   }

   public boolean visit(SQLServerSelectSubqueryTableSource x) {
      return true;
   }

   public void endVisit(SQLServerSelectSubqueryTableSource x) {
   }

   public boolean visit(SQLServerValuesTableSource x) {
      return true;
   }

   public void endVisit(SQLServerValuesTableSource x) {
   }

   public boolean visit(SQLServerUnionQueryTableSource x) {
      return true;
   }

   public void endVisit(SQLServerUnionQueryTableSource x) {
   }

   public boolean visit(SQLServerSelectTableReference x) {
      return true;
   }

   public void endVisit(SQLServerSelectTableReference x) {
   }

   public boolean visit(SQLServerCurrentOfCursorExpr x) {
      return true;
   }

   public void endVisit(SQLServerCurrentOfCursorExpr x) {
   }

   public boolean visit(SQLServerMergeStatement.MergeDeleteClause x) {
      return true;
   }

   public void endVisit(SQLServerMergeStatement.MergeDeleteClause x) {
   }

   public boolean visit(SQLServerMergeStatement x) {
      return true;
   }

   public void endVisit(SQLServerMergeStatement x) {
   }

   public boolean visit(SQLServerMergeStatement.SQLServerMergeInsertClause x) {
      return true;
   }

   public void endVisit(SQLServerMergeStatement.SQLServerMergeInsertClause x) {
   }

   public boolean visit(SQLServerMergeStatement.SQLServerMergeUpdateClause x) {
      return true;
   }

   public void endVisit(SQLServerMergeStatement.SQLServerMergeUpdateClause x) {
   }
}
