test_class.declarator: SQL = "DELETE FROM table_x WHERE id=?"
test_class.modifier: private static final
test_class.original_string: private static final String SQL = "DELETE FROM table_x WHERE id=?";
test_class.type: String
test_class.var_name: SQL
test_class.declarator: actual
test_class.modifier: private
test_class.original_string: private BatchPreparedStatementExecutor actual;
test_class.type: BatchPreparedStatementExecutor
test_class.var_name: actual
test_class.declarator: sqlStatementContext
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private SQLStatementContext<?> sqlStatementContext;
test_class.type: SQLStatementContext<?>
test_class.var_name: sqlStatementContext
test_class.file: shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/executor/batch/BatchPreparedStatementExecutorTest.java
test_class.identifier: BatchPreparedStatementExecutorTest
test_class.superclass: extends AbstractBaseExecutorTest
test_case.body: @Test
      public void assertNoPreparedStatement() throws SQLException {
          PreparedStatement preparedStatement = getPreparedStatement();
          when(preparedStatement.executeBatch()).thenReturn(new int[] {0, 0});
          setExecuteGroups(Collections.singletonList(preparedStatement));
          assertThat(actual.executeBatch(sqlStatementContext), is(new int[] {0, 0}));
      }
test_case.class_method_signature: BatchPreparedStatementExecutorTest.assertNoPreparedStatement()
test_case.full_signature: @Test public void assertNoPreparedStatement()
test_case.identifier: assertNoPreparedStatement
test_case.invocations: getPreparedStatement thenReturn when executeBatch setExecuteGroups singletonList assertThat executeBatch is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertNoPreparedStatement()
focal_class.declarator: schemaContexts
focal_class.modifier: private final
focal_class.original_string: private final SchemaContexts schemaContexts;
focal_class.type: SchemaContexts
focal_class.var_name: schemaContexts
focal_class.declarator: sqlExecutor
focal_class.modifier: private final
focal_class.original_string: private final SQLExecutor sqlExecutor;
focal_class.type: SQLExecutor
focal_class.var_name: sqlExecutor
focal_class.declarator: inputGroups
focal_class.modifier: private final
focal_class.original_string: private final Collection<InputGroup<StatementExecuteUnit>> inputGroups;
focal_class.type: Collection<InputGroup<StatementExecuteUnit>>
focal_class.var_name: inputGroups
focal_class.declarator: batchExecutionUnits
focal_class.modifier: @Getter
      private final
focal_class.original_string: @Getter
      private final Collection<BatchExecutionUnit> batchExecutionUnits;
focal_class.type: Collection<BatchExecutionUnit>
focal_class.var_name: batchExecutionUnits
focal_class.declarator: batchCount
focal_class.modifier: private
focal_class.original_string: private int batchCount;
focal_class.type: int
focal_class.var_name: batchCount
focal_class.file: shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/batch/BatchPreparedStatementExecutor.java
focal_class.identifier: BatchPreparedStatementExecutor
focal_class.class_method_signature: BatchPreparedStatementExecutor.BatchPreparedStatementExecutor(final SchemaContexts schemaContexts, final SQLExecutor sqlExecutor)
focal_class.full_signature: public  BatchPreparedStatementExecutor(final SchemaContexts schemaContexts, final SQLExecutor sqlExecutor)
focal_class.identifier: BatchPreparedStatementExecutor
focal_class.modifiers: public
focal_class.parameters: (final SchemaContexts schemaContexts, final SQLExecutor sqlExecutor)
focal_class.signature:  BatchPreparedStatementExecutor(final SchemaContexts schemaContexts, final SQLExecutor sqlExecutor)
focal_class.class_method_signature: BatchPreparedStatementExecutor.init(final Collection<InputGroup<StatementExecuteUnit>> inputGroups)
focal_class.full_signature: public void init(final Collection<InputGroup<StatementExecuteUnit>> inputGroups)
focal_class.identifier: init
focal_class.modifiers: public
focal_class.parameters: (final Collection<InputGroup<StatementExecuteUnit>> inputGroups)
focal_class.return: void
focal_class.signature: void init(final Collection<InputGroup<StatementExecuteUnit>> inputGroups)
focal_class.class_method_signature: BatchPreparedStatementExecutor.addBatchForExecutionUnits(final Collection<ExecutionUnit> executionUnits)
focal_class.full_signature: public void addBatchForExecutionUnits(final Collection<ExecutionUnit> executionUnits)
focal_class.identifier: addBatchForExecutionUnits
focal_class.modifiers: public
focal_class.parameters: (final Collection<ExecutionUnit> executionUnits)
focal_class.return: void
focal_class.signature: void addBatchForExecutionUnits(final Collection<ExecutionUnit> executionUnits)
focal_class.class_method_signature: BatchPreparedStatementExecutor.createBatchExecutionUnits(final Collection<ExecutionUnit> executionUnits)
focal_class.full_signature: private Collection<BatchExecutionUnit> createBatchExecutionUnits(final Collection<ExecutionUnit> executionUnits)
focal_class.identifier: createBatchExecutionUnits
focal_class.modifiers: private
focal_class.parameters: (final Collection<ExecutionUnit> executionUnits)
focal_class.return: Collection<BatchExecutionUnit>
focal_class.signature: Collection<BatchExecutionUnit> createBatchExecutionUnits(final Collection<ExecutionUnit> executionUnits)
focal_class.class_method_signature: BatchPreparedStatementExecutor.handleOldBatchExecutionUnits(final Collection<BatchExecutionUnit> newExecutionUnits)
focal_class.full_signature: private void handleOldBatchExecutionUnits(final Collection<BatchExecutionUnit> newExecutionUnits)
focal_class.identifier: handleOldBatchExecutionUnits
focal_class.modifiers: private
focal_class.parameters: (final Collection<BatchExecutionUnit> newExecutionUnits)
focal_class.return: void
focal_class.signature: void handleOldBatchExecutionUnits(final Collection<BatchExecutionUnit> newExecutionUnits)
focal_class.class_method_signature: BatchPreparedStatementExecutor.reviseBatchExecutionUnits(final BatchExecutionUnit batchExecutionUnit)
focal_class.full_signature: private void reviseBatchExecutionUnits(final BatchExecutionUnit batchExecutionUnit)
focal_class.identifier: reviseBatchExecutionUnits
focal_class.modifiers: private
focal_class.parameters: (final BatchExecutionUnit batchExecutionUnit)
focal_class.return: void
focal_class.signature: void reviseBatchExecutionUnits(final BatchExecutionUnit batchExecutionUnit)
focal_class.class_method_signature: BatchPreparedStatementExecutor.reviseBatchExecutionUnit(final BatchExecutionUnit oldBatchExecutionUnit, final BatchExecutionUnit newBatchExecutionUnit)
focal_class.full_signature: private void reviseBatchExecutionUnit(final BatchExecutionUnit oldBatchExecutionUnit, final BatchExecutionUnit newBatchExecutionUnit)
focal_class.identifier: reviseBatchExecutionUnit
focal_class.modifiers: private
focal_class.parameters: (final BatchExecutionUnit oldBatchExecutionUnit, final BatchExecutionUnit newBatchExecutionUnit)
focal_class.return: void
focal_class.signature: void reviseBatchExecutionUnit(final BatchExecutionUnit oldBatchExecutionUnit, final BatchExecutionUnit newBatchExecutionUnit)
focal_class.class_method_signature: BatchPreparedStatementExecutor.handleNewBatchExecutionUnits(final Collection<BatchExecutionUnit> newExecutionUnits)
focal_class.full_signature: private void handleNewBatchExecutionUnits(final Collection<BatchExecutionUnit> newExecutionUnits)
focal_class.identifier: handleNewBatchExecutionUnits
focal_class.modifiers: private
focal_class.parameters: (final Collection<BatchExecutionUnit> newExecutionUnits)
focal_class.return: void
focal_class.signature: void handleNewBatchExecutionUnits(final Collection<BatchExecutionUnit> newExecutionUnits)
focal_class.class_method_signature: BatchPreparedStatementExecutor.executeBatch(final SQLStatementContext sqlStatementContext)
focal_class.full_signature: public int[] executeBatch(final SQLStatementContext sqlStatementContext)
focal_class.identifier: executeBatch
focal_class.modifiers: public
focal_class.parameters: (final SQLStatementContext sqlStatementContext)
focal_class.return: int[]
focal_class.signature: int[] executeBatch(final SQLStatementContext sqlStatementContext)
focal_class.class_method_signature: BatchPreparedStatementExecutor.isNeedAccumulate(final Collection<ShardingSphereRule> rules, final SQLStatementContext sqlStatementContext)
focal_class.full_signature: private boolean isNeedAccumulate(final Collection<ShardingSphereRule> rules, final SQLStatementContext sqlStatementContext)
focal_class.identifier: isNeedAccumulate
focal_class.modifiers: private
focal_class.parameters: (final Collection<ShardingSphereRule> rules, final SQLStatementContext sqlStatementContext)
focal_class.return: boolean
focal_class.signature: boolean isNeedAccumulate(final Collection<ShardingSphereRule> rules, final SQLStatementContext sqlStatementContext)
focal_class.class_method_signature: BatchPreparedStatementExecutor.accumulate(final List<int[]> results)
focal_class.full_signature: private int[] accumulate(final List<int[]> results)
focal_class.identifier: accumulate
focal_class.modifiers: private
focal_class.parameters: (final List<int[]> results)
focal_class.return: int[]
focal_class.signature: int[] accumulate(final List<int[]> results)
focal_class.class_method_signature: BatchPreparedStatementExecutor.isSameDataSourceAndSQL(final BatchExecutionUnit batchExecutionUnit, final StatementExecuteUnit statementExecuteUnit)
focal_class.full_signature: private boolean isSameDataSourceAndSQL(final BatchExecutionUnit batchExecutionUnit, final StatementExecuteUnit statementExecuteUnit)
focal_class.identifier: isSameDataSourceAndSQL
focal_class.modifiers: private
focal_class.parameters: (final BatchExecutionUnit batchExecutionUnit, final StatementExecuteUnit statementExecuteUnit)
focal_class.return: boolean
focal_class.signature: boolean isSameDataSourceAndSQL(final BatchExecutionUnit batchExecutionUnit, final StatementExecuteUnit statementExecuteUnit)
focal_class.class_method_signature: BatchPreparedStatementExecutor.getStatements()
focal_class.full_signature: public List<Statement> getStatements()
focal_class.identifier: getStatements
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<Statement>
focal_class.signature: List<Statement> getStatements()
focal_class.class_method_signature: BatchPreparedStatementExecutor.getParameterSet(final Statement statement)
focal_class.full_signature: public List<List<Object>> getParameterSet(final Statement statement)
focal_class.identifier: getParameterSet
focal_class.modifiers: public
focal_class.parameters: (final Statement statement)
focal_class.return: List<List<Object>>
focal_class.signature: List<List<Object>> getParameterSet(final Statement statement)
focal_class.class_method_signature: BatchPreparedStatementExecutor.findStatementExecuteUnit(final Statement statement, final InputGroup<StatementExecuteUnit> executeGroup)
focal_class.full_signature: private Optional<StatementExecuteUnit> findStatementExecuteUnit(final Statement statement, final InputGroup<StatementExecuteUnit> executeGroup)
focal_class.identifier: findStatementExecuteUnit
focal_class.modifiers: private
focal_class.parameters: (final Statement statement, final InputGroup<StatementExecuteUnit> executeGroup)
focal_class.return: Optional<StatementExecuteUnit>
focal_class.signature: Optional<StatementExecuteUnit> findStatementExecuteUnit(final Statement statement, final InputGroup<StatementExecuteUnit> executeGroup)
focal_class.class_method_signature: BatchPreparedStatementExecutor.getParameterSets(final StatementExecuteUnit executeUnit)
focal_class.full_signature: private List<List<Object>> getParameterSets(final StatementExecuteUnit executeUnit)
focal_class.identifier: getParameterSets
focal_class.modifiers: private
focal_class.parameters: (final StatementExecuteUnit executeUnit)
focal_class.return: List<List<Object>>
focal_class.signature: List<List<Object>> getParameterSets(final StatementExecuteUnit executeUnit)
focal_class.class_method_signature: BatchPreparedStatementExecutor.clear()
focal_class.full_signature: public void clear()
focal_class.identifier: clear
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clear()
focal_class.class_method_signature: BatchPreparedStatementExecutor.closeStatements()
focal_class.full_signature: private void closeStatements()
focal_class.identifier: closeStatements
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void closeStatements()
focal_method.body: public int[] executeBatch(final SQLStatementContext sqlStatementContext) throws SQLException {
          boolean isExceptionThrown = ExecutorExceptionHandler.isExceptionThrown();
          SQLExecutorCallback<int[]> callback = new DefaultSQLExecutorCallback<int[]>(schemaContexts.getDatabaseType(), isExceptionThrown) {
              
              @Override
              protected int[] executeSQL(final String sql, final Statement statement, final ConnectionMode connectionMode) throws SQLException {
                  return statement.executeBatch();
              }
          };
          List<int[]> results = sqlExecutor.execute(inputGroups, callback);
          return isNeedAccumulate(
                  schemaContexts.getDefaultSchema().getRules().stream().filter(rule -> rule instanceof DataNodeRoutedRule).collect(Collectors.toList()), sqlStatementContext)
                  ? accumulate(results) : results.get(0);
      }
focal_method.class_method_signature: BatchPreparedStatementExecutor.executeBatch(final SQLStatementContext sqlStatementContext)
focal_method.full_signature: public int[] executeBatch(final SQLStatementContext sqlStatementContext)
focal_method.identifier: executeBatch
focal_method.invocations: isExceptionThrown getDatabaseType executeBatch execute isNeedAccumulate collect filter stream getRules getDefaultSchema toList accumulate get
focal_method.modifiers: public
focal_method.parameters: (final SQLStatementContext sqlStatementContext)
focal_method.return: int[]
focal_method.signature: int[] executeBatch(final SQLStatementContext sqlStatementContext)