Skip to content

Commit 815971b

Browse files
committed
Revert "DATACOUCH-650 - Implements CrudRepository and ReactiveCrudRepository.deleteById(Iterable<ID> ids)."
This reverts commit f8b7749.
1 parent d99f336 commit 815971b

File tree

5 files changed

+18
-85
lines changed

5 files changed

+18
-85
lines changed

pom.xml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<properties>
2121
<couchbase>3.0.10</couchbase>
2222
<couchbase.osgi>3.0.10</couchbase.osgi>
23-
<springdata.commons>2.4.0-DATACMNS-800-SNAPSHOT</springdata.commons>
23+
<springdata.commons>2.3.7.BUILD-SNAPSHOT</springdata.commons>
2424
<java-module-name>spring.data.couchbase</java-module-name>
2525
</properties>
2626

@@ -161,12 +161,6 @@
161161
<scope>test</scope>
162162
</dependency>
163163

164-
<dependency>
165-
<groupId>io.projectreactor</groupId>
166-
<artifactId>reactor-test</artifactId>
167-
<scope>test</scope>
168-
</dependency>
169-
170164
<!-- Kotlin extension -->
171165
<dependency>
172166
<groupId>org.jetbrains.kotlin</groupId>

src/main/java/org/springframework/data/couchbase/repository/support/SimpleCouchbaseRepository.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
*
4343
* @author Michael Nitschinger
4444
* @author Mark Paluch
45-
* @author Jens Schauder
4645
*/
4746
public class SimpleCouchbaseRepository<T, ID> implements CouchbaseRepository<T, ID> {
4847

@@ -131,12 +130,6 @@ public void deleteAll(final Iterable<? extends T> entities) {
131130
couchbaseOperations.removeById().all(Streamable.of(entities).map(entityInformation::getId).toList());
132131
}
133132

134-
@Override
135-
public void deleteAllById(Iterable<? extends ID> ids) {
136-
Assert.notNull(ids, "The given Iterable of ids must not be null!");
137-
couchbaseOperations.removeById().all(Streamable.of(ids).map(Objects::toString).toList());
138-
}
139-
140133
@Override
141134
public long count() {
142135
return couchbaseOperations.findByQuery(entityInformation.getJavaType()).consistentWith(buildQueryScanConsistency())

src/main/java/org/springframework/data/couchbase/repository/support/SimpleReactiveCouchbaseRepository.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
* @author Christoph Strobl
4545
* @author David Kelly
4646
* @author Douglas Six
47-
* @author Jens Schauder
4847
* @since 3.0
4948
*/
5049
public class SimpleReactiveCouchbaseRepository<T, ID> implements ReactiveCouchbaseRepository<T, ID> {
@@ -186,11 +185,6 @@ public Mono<Void> deleteAll(final Publisher<? extends T> entityStream) {
186185
return Flux.from(entityStream).flatMap(this::delete).single();
187186
}
188187

189-
@Override
190-
public Mono<Void> deleteAllById(final Iterable<? extends ID> ids) {
191-
return operations.removeById().all(Streamable.of(ids).map(Object::toString).toList()).then();
192-
}
193-
194188
@SuppressWarnings("unchecked")
195189
@Override
196190
public Mono<Long> count() {

src/test/java/org/springframework/data/couchbase/repository/CouchbaseRepositoryQueryIntegrationTests.java

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package org.springframework.data.couchbase.repository;
1818

19-
import static java.util.Arrays.*;
20-
import static org.assertj.core.api.Assertions.*;
2119
import static org.junit.jupiter.api.Assertions.*;
2220

2321
import java.util.ArrayList;
@@ -28,7 +26,6 @@
2826
import java.util.concurrent.ExecutorService;
2927
import java.util.concurrent.Executors;
3028
import java.util.concurrent.Future;
31-
import java.util.stream.Collectors;
3229

3330
import org.junit.jupiter.api.BeforeEach;
3431
import org.junit.jupiter.api.Test;
@@ -50,7 +47,6 @@
5047
import org.springframework.data.couchbase.util.ClusterAwareIntegrationTests;
5148
import org.springframework.data.couchbase.util.ClusterType;
5249
import org.springframework.data.couchbase.util.IgnoreWhen;
53-
import org.springframework.data.util.StreamUtils;
5450
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
5551

5652
import com.couchbase.client.core.error.IndexExistsException;
@@ -60,7 +56,6 @@
6056
*
6157
* @author Michael Nitschinger
6258
* @author Michael Reiche
63-
* @author Jens Schauder
6459
*/
6560
@SpringJUnitConfig(CouchbaseRepositoryQueryIntegrationTests.Config.class)
6661
@IgnoreWhen(missesCapabilities = Capabilities.QUERY, clusterTypes = ClusterType.MOCKED)
@@ -175,7 +170,7 @@ void count() {
175170
airportRepository.save(airport);
176171
}
177172

178-
Long count = airportRepository.countFancyExpression(asList("JFK"), asList("jfk"), false);
173+
Long count = airportRepository.countFancyExpression(Arrays.asList("JFK"), Arrays.asList("jfk"), false);
179174
assertEquals(1, count);
180175

181176
long airportCount = airportRepository.count();
@@ -282,25 +277,6 @@ void threadSafeStringParametersTest() throws Exception {
282277
}
283278
}
284279

285-
@Test // DATACOUCH-650
286-
void deleteAllById() {
287-
288-
Airport vienna = new Airport("airports::vie", "vie", "LOWW");
289-
Airport frankfurt = new Airport("airports::fra", "fra", "EDDF");
290-
Airport losAngeles = new Airport("airports::lax", "lax", "KLAX");
291-
292-
try {
293-
airportRepository.saveAll(asList(vienna, frankfurt, losAngeles));
294-
295-
airportRepository.deleteAllById(asList(vienna.getId(), losAngeles.getId()));
296-
297-
298-
assertThat(airportRepository.findAll()).containsExactly(frankfurt);
299-
} finally {
300-
airportRepository.deleteAll();
301-
}
302-
}
303-
304280
private void sleep(int millis) {
305281
try {
306282
Thread.sleep(millis); // so they are executed out-of-order

src/test/java/org/springframework/data/couchbase/repository/ReactiveCouchbaseRepositoryQueryIntegrationTests.java

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@
1616

1717
package org.springframework.data.couchbase.repository;
1818

19-
import com.couchbase.client.core.error.IndexExistsException;
19+
import static org.junit.jupiter.api.Assertions.*;
20+
21+
import java.util.List;
22+
import java.util.concurrent.Callable;
23+
import java.util.concurrent.ExecutorService;
24+
import java.util.concurrent.Executors;
25+
import java.util.concurrent.Future;
26+
import java.util.stream.Collectors;
27+
2028
import org.junit.jupiter.api.BeforeEach;
2129
import org.junit.jupiter.api.Test;
2230
import org.springframework.beans.factory.annotation.Autowired;
@@ -35,18 +43,8 @@
3543
import org.springframework.data.couchbase.util.ClusterType;
3644
import org.springframework.data.couchbase.util.IgnoreWhen;
3745
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
38-
import reactor.test.StepVerifier;
3946

40-
import java.util.List;
41-
import java.util.concurrent.Callable;
42-
import java.util.concurrent.ExecutorService;
43-
import java.util.concurrent.Executors;
44-
import java.util.concurrent.Future;
45-
import java.util.stream.Collectors;
46-
47-
import static java.util.Arrays.*;
48-
import static org.assertj.core.api.Assertions.*;
49-
import static org.junit.jupiter.api.Assertions.*;
47+
import com.couchbase.client.core.error.IndexExistsException;
5048

5149
/**
5250
* template class for Reactive Couchbase operations
@@ -58,13 +56,10 @@
5856
@IgnoreWhen(missesCapabilities = Capabilities.QUERY, clusterTypes = ClusterType.MOCKED)
5957
public class ReactiveCouchbaseRepositoryQueryIntegrationTests extends ClusterAwareIntegrationTests {
6058

61-
@Autowired
62-
CouchbaseClientFactory clientFactory;
59+
@Autowired CouchbaseClientFactory clientFactory;
6360

64-
@Autowired
65-
ReactiveAirportRepository airportRepository; // intellij flags "Could not Autowire", but it runs ok.
66-
@Autowired
67-
ReactiveUserRepository userRepository; // intellij flags "Could not Autowire", but it runs ok.
61+
@Autowired ReactiveAirportRepository airportRepository; // intellij flags "Could not Autowire", but it runs ok.
62+
@Autowired ReactiveUserRepository userRepository; // intellij flags "Could not Autowire", but it runs ok.
6863

6964
@BeforeEach
7065
void beforeEach() {
@@ -98,9 +93,9 @@ void findBySimpleProperty() {
9893
vie = new Airport("airports::vie", "vie", "loww");
9994
airportRepository.save(vie).block();
10095
List<Airport> airports1 = airportRepository.findAllByIata("vie").collectList().block();
101-
assertEquals(1, airports1.size());
96+
assertEquals(1,airports1.size());
10297
List<Airport> airports2 = airportRepository.findAllByIata("vie").collectList().block();
103-
assertEquals(1, airports2.size());
98+
assertEquals(1,airports2.size());
10499
} finally {
105100
airportRepository.delete(vie).block();
106101
}
@@ -119,7 +114,7 @@ public void testCas() {
119114

120115
@Test
121116
void count() {
122-
String[] iatas = {"JFK", "IAD", "SFO", "SJC", "SEA", "LAX", "PHX"};
117+
String[] iatas = { "JFK", "IAD", "SFO", "SJC", "SEA", "LAX", "PHX" };
123118
Future[] future = new Future[iatas.length];
124119
ExecutorService executorService = Executors.newFixedThreadPool(iatas.length);
125120
try {
@@ -153,25 +148,6 @@ void count() {
153148
}
154149
}
155150

156-
@Test
157-
// DATACOUCH-650
158-
void deleteAllById() {
159-
160-
Airport vienna = new Airport("airports::vie", "vie", "LOWW");
161-
Airport frankfurt = new Airport("airports::fra", "fra", "EDDF");
162-
Airport losAngeles = new Airport("airports::lax", "lax", "KLAX");
163-
164-
try {
165-
airportRepository.saveAll(asList(vienna, frankfurt, losAngeles)).as(StepVerifier::create).verifyComplete();
166-
167-
airportRepository.deleteAllById(asList(vienna.getId(), losAngeles.getId())).as(StepVerifier::create).verifyComplete();
168-
169-
airportRepository.findAll().as(StepVerifier::create).expectNext(frankfurt).verifyComplete();
170-
} finally {
171-
airportRepository.deleteAll();
172-
}
173-
}
174-
175151
@Configuration
176152
@EnableReactiveCouchbaseRepositories("org.springframework.data.couchbase")
177153
static class Config extends AbstractCouchbaseConfiguration {

0 commit comments

Comments
 (0)