DefaultSyncRepository extends DefaultRepository<E> implements SyncRepository<E, K> { @Override public int insertBatch(Collection<E> batch) { if (batch.size() == 0) { return 0; } return doInsert(batch).sync(); } DefaultSyncRepository(DatabaseOperator operator, String table, Class<E> type, ResultWrapper<E, ?> wrapper);  DefaultSyncRepository(DatabaseOperator operator, RDBTableMetadata table, Class<E> type, ResultWrapper<E, ?> wrapper);  DefaultSyncRepository(DatabaseOperator operator, Supplier<RDBTableMetadata> table, Class<E> type, ResultWrapper<E, ?> wrapper); @Override E newInstance(); @Override int deleteById(Collection<K> idList); @Override int updateById(K id, E data); @Override SaveResult save(Collection<E> list); @Override Optional<E> findById(K primaryKey); @Override List<E> findById(Collection<K> primaryKey); @Override void insert(E data); @Override int insertBatch(Collection<E> batch); @Override SyncQuery<E> createQuery(); @Override SyncUpdate<E> createUpdate(); @Override SyncDelete createDelete();  }
@Test public void testInsertBatch() { List<TestEntity> list = Flux.range(0, 100) .map(i -> { TestEntity entity = new TestEntity(); entity.setId("test_" + i); entity.setName("test_" + i); if (i < 10) { entity.setState((byte) 1); } entity.setCreateTime(new Date()); return entity; }) .collectList() .block(); Assert.assertEquals(100, repository.insertBatch(list)); }