diff --git a/README.md b/README.md index 130e4a46..6bd416c7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,6 @@ We have separate folders for the samples of individual modules: ## Spring Data for Apache Cassandra * `example` - Shows core Spring Data support for Apache Cassandra. -* `java8` - Java 8 specific functionality like the support for JSR-310 types in object mapping. * `kotlin` - Example for using Cassandra with Kotlin. * `reactive` - Example project to show reactive template and repository support. @@ -57,7 +56,6 @@ We have separate folders for the samples of individual modules: * `fluent-api` - Example project to show the new fluent API (`MongoTemplate`-alternative) to interact with MongoDB. * `geo-json` - Example project showing usage of [GeoJSON](http://geojson.org) with MongoDB. * `gridfs` - Example project showing usage of gridFS with MongoDB. -* `java8` - Example of how to use Spring Data MongoDB with Java 8 date time types as well as the usage of `Optional` as return type for repository methods. Note, this project requires to be build with JDK 8. * `jmolecules` - Example of Spring Data MongoDB working with a jMolecules based domain model. * `kotlin` - Example for using [Kotlin](https://kotlinlang.org/) with MongoDB. * `query-by-example` - Example project showing usage of Query by Example with MongoDB. diff --git a/cassandra/java8/src/main/java/example/springdata/cassandra/java8/CassandraConfiguration.java b/cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/CassandraConfiguration.java similarity index 81% rename from cassandra/java8/src/main/java/example/springdata/cassandra/java8/CassandraConfiguration.java rename to cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/CassandraConfiguration.java index 9e7fa535..217fd1db 100644 --- a/cassandra/java8/src/main/java/example/springdata/cassandra/java8/CassandraConfiguration.java +++ b/cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/CassandraConfiguration.java @@ -1,11 +1,11 @@ /* - * Copyright 2016-2021 the original author or authors. + * Copyright 2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package example.springdata.cassandra.java8; +package example.springdata.cassandra.streamoptional; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/cassandra/java8/src/main/java/example/springdata/cassandra/java8/Order.java b/cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/Order.java similarity index 85% rename from cassandra/java8/src/main/java/example/springdata/cassandra/java8/Order.java rename to cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/Order.java index eabe035c..28986be1 100644 --- a/cassandra/java8/src/main/java/example/springdata/cassandra/java8/Order.java +++ b/cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/Order.java @@ -1,11 +1,11 @@ /* - * Copyright 2016-2021 the original author or authors. + * Copyright 2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package example.springdata.cassandra.java8; +package example.springdata.cassandra.streamoptional; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/cassandra/java8/src/main/java/example/springdata/cassandra/java8/OrderRepository.java b/cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/OrderRepository.java similarity index 83% rename from cassandra/java8/src/main/java/example/springdata/cassandra/java8/OrderRepository.java rename to cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/OrderRepository.java index 7b681d42..126a0174 100644 --- a/cassandra/java8/src/main/java/example/springdata/cassandra/java8/OrderRepository.java +++ b/cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/OrderRepository.java @@ -1,11 +1,11 @@ /* - * Copyright 2016-2021 the original author or authors. + * Copyright 2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,12 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package example.springdata.cassandra.java8; +package example.springdata.cassandra.streamoptional; import java.time.LocalDate; import java.time.ZoneId; -import org.springframework.data.cassandra.core.mapping.CassandraType; import org.springframework.data.cassandra.repository.Query; import org.springframework.data.repository.Repository; diff --git a/cassandra/java8/src/main/java/example/springdata/cassandra/java8/Person.java b/cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/Person.java similarity index 84% rename from cassandra/java8/src/main/java/example/springdata/cassandra/java8/Person.java rename to cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/Person.java index fa56da8e..0fa9730c 100644 --- a/cassandra/java8/src/main/java/example/springdata/cassandra/java8/Person.java +++ b/cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/Person.java @@ -1,11 +1,11 @@ /* - * Copyright 2016-2021 the original author or authors. + * Copyright 2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -package example.springdata.cassandra.java8; +package example.springdata.cassandra.streamoptional; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/cassandra/java8/src/main/java/example/springdata/cassandra/java8/PersonRepository.java b/cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/PersonRepository.java similarity index 90% rename from cassandra/java8/src/main/java/example/springdata/cassandra/java8/PersonRepository.java rename to cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/PersonRepository.java index 341029b5..408f8643 100644 --- a/cassandra/java8/src/main/java/example/springdata/cassandra/java8/PersonRepository.java +++ b/cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/PersonRepository.java @@ -1,11 +1,11 @@ /* - * Copyright 2016-2021 the original author or authors. + * Copyright 2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package example.springdata.cassandra.java8; +package example.springdata.cassandra.streamoptional; import java.util.Optional; import java.util.stream.Stream; diff --git a/mongodb/java8/src/main/java/example/springdata/mongodb/people/Person.java b/cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/package-info.java similarity index 52% rename from mongodb/java8/src/main/java/example/springdata/mongodb/people/Person.java rename to cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/package-info.java index fdbcf815..fe7ea764 100644 --- a/mongodb/java8/src/main/java/example/springdata/mongodb/people/Person.java +++ b/cassandra/example/src/main/java/example/springdata/cassandra/streamoptional/package-info.java @@ -1,11 +1,11 @@ /* - * Copyright 2015-2021 the original author or authors. + * Copyright 2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,23 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package example.springdata.mongodb.people; - -import lombok.Data; -import lombok.RequiredArgsConstructor; - -import org.springframework.data.annotation.Id; /** - * An entity to represent a Person. - * - * @author Thomas Darimont + * Package showing Java 8 features. */ -@Data -@RequiredArgsConstructor -public class Person { - - private @Id String id; - private final String firstname; - private final String lastname; -} +package example.springdata.cassandra.streamoptional; diff --git a/cassandra/java8/src/test/java/example/springdata/cassandra/java8/Jsr310IntegrationTests.java b/cassandra/example/src/test/java/example/springdata/cassandra/streamoptional/Jsr310IntegrationTests.java similarity index 87% rename from cassandra/java8/src/test/java/example/springdata/cassandra/java8/Jsr310IntegrationTests.java rename to cassandra/example/src/test/java/example/springdata/cassandra/streamoptional/Jsr310IntegrationTests.java index c2281245..63d23406 100755 --- a/cassandra/java8/src/test/java/example/springdata/cassandra/java8/Jsr310IntegrationTests.java +++ b/cassandra/example/src/test/java/example/springdata/cassandra/streamoptional/Jsr310IntegrationTests.java @@ -1,11 +1,11 @@ /* - * Copyright 2016-2021 the original author or authors. + * Copyright 2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package example.springdata.cassandra.java8; - -import static org.assertj.core.api.Assertions.*; +package example.springdata.cassandra.streamoptional; import example.springdata.cassandra.util.CassandraKeyspace; diff --git a/cassandra/java8/src/test/java/example/springdata/cassandra/java8/Java8IntegrationTests.java b/cassandra/example/src/test/java/example/springdata/cassandra/streamoptional/StreamOptionalIntegrationTests.java similarity index 87% rename from cassandra/java8/src/test/java/example/springdata/cassandra/java8/Java8IntegrationTests.java rename to cassandra/example/src/test/java/example/springdata/cassandra/streamoptional/StreamOptionalIntegrationTests.java index 30cfd755..8734c995 100755 --- a/cassandra/java8/src/test/java/example/springdata/cassandra/java8/Java8IntegrationTests.java +++ b/cassandra/example/src/test/java/example/springdata/cassandra/streamoptional/StreamOptionalIntegrationTests.java @@ -1,11 +1,11 @@ /* - * Copyright 2016-2021 the original author or authors. + * Copyright 2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package example.springdata.cassandra.java8; +package example.springdata.cassandra.streamoptional; import static org.assertj.core.api.Assertions.*; @@ -30,13 +30,13 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; /** - * Integration test to show the usage of Java 8 features with Spring Data Cassandra. + * Integration test to show the usage of Java {@link Stream} and {@link Optional} features with Spring Data Cassandra. * * @author Mark Paluch */ @CassandraKeyspace @SpringBootTest(classes = CassandraConfiguration.class) -class Java8IntegrationTests { +class StreamOptionalIntegrationTests { @Autowired PersonRepository repository; diff --git a/cassandra/java8/README.md b/cassandra/java8/README.md deleted file mode 100644 index 8253681f..00000000 --- a/cassandra/java8/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# Spring Data Cassandra - Java 8 examples - -This project contains samples of Java 8 specific features of Spring Data (Cassandra). - -## Support for JDK 8's `Stream` for repository methods - -Repository methods can use a Java 8 `Stream` as a return type which will cause the reading of the results and the to-object-conversion of rows to happen while iterating over the stream. - -```java -public interface PersonRepository extends CrudRepository { - - @Override - List findAll(); - - // Derived query method returning a Java 8 Stream - Stream findAll(); -} -``` - -The test cases in `PersonRepositoryIntegrationTest` oppose a plain `List` based query method with one that uses a `Stream` and shows how the former pulls all data into memory first and the iteration is done over the pre-populated list. The execution of the `Stream`-based method in contrast shows that the individual elements are read and converted while iterating the stream. diff --git a/cassandra/java8/pom.xml b/cassandra/java8/pom.xml deleted file mode 100644 index 20fb0e32..00000000 --- a/cassandra/java8/pom.xml +++ /dev/null @@ -1,26 +0,0 @@ - - 4.0.0 - - - org.springframework.data.examples - spring-data-cassandra-examples - 2.0.0.BUILD-SNAPSHOT - ../pom.xml - - - spring-data-cassandra-java8 - Spring Data Cassandra - Java 8 specific features - - - - - ${project.groupId} - spring-data-cassandra-example-utils - ${project.version} - test - - - - - diff --git a/cassandra/java8/src/main/java/example/springdata/cassandra/java8/package-info.java b/cassandra/java8/src/main/java/example/springdata/cassandra/java8/package-info.java deleted file mode 100644 index 476e1287..00000000 --- a/cassandra/java8/src/main/java/example/springdata/cassandra/java8/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Package showing Java 8 features. - */ -package example.springdata.cassandra.java8; diff --git a/cassandra/java8/src/main/resources/application.properties b/cassandra/java8/src/main/resources/application.properties deleted file mode 100644 index 137ca04d..00000000 --- a/cassandra/java8/src/main/resources/application.properties +++ /dev/null @@ -1,3 +0,0 @@ -spring.data.cassandra.keyspace-name=example -spring.data.cassandra.schema-action=recreate -spring.data.cassandra.local-datacenter=datacenter1 diff --git a/cassandra/pom.xml b/cassandra/pom.xml index 67c31917..720e065b 100644 --- a/cassandra/pom.xml +++ b/cassandra/pom.xml @@ -19,7 +19,6 @@ util example - java8 kotlin reactive diff --git a/mongodb/example/src/main/java/example/springdata/mongodb/customer/CustomerRepository.java b/mongodb/example/src/main/java/example/springdata/mongodb/customer/CustomerRepository.java index efa33a18..a1fd0ca6 100644 --- a/mongodb/example/src/main/java/example/springdata/mongodb/customer/CustomerRepository.java +++ b/mongodb/example/src/main/java/example/springdata/mongodb/customer/CustomerRepository.java @@ -16,11 +16,13 @@ package example.springdata.mongodb.customer; import java.util.List; +import java.util.stream.Stream; import org.springframework.data.domain.Sort; import org.springframework.data.geo.Distance; import org.springframework.data.geo.GeoResults; import org.springframework.data.geo.Point; +import org.springframework.data.mongodb.repository.Query; import org.springframework.data.repository.CrudRepository; /** @@ -47,4 +49,7 @@ public interface CustomerRepository extends CrudRepository { * @return */ GeoResults findByAddressLocationNear(Point point, Distance distance); + + @Query("{}") + Stream findAllByCustomQueryWithStream(); } diff --git a/mongodb/example/src/test/java/example/springdata/mongodb/customer/CustomerRepositoryIntegrationTest.java b/mongodb/example/src/test/java/example/springdata/mongodb/customer/CustomerRepositoryIntegrationTest.java index 8bae0318..76138bab 100644 --- a/mongodb/example/src/test/java/example/springdata/mongodb/customer/CustomerRepositoryIntegrationTest.java +++ b/mongodb/example/src/test/java/example/springdata/mongodb/customer/CustomerRepositoryIntegrationTest.java @@ -19,6 +19,7 @@ import static org.hamcrest.Matchers.*; import static org.junit.Assert.*; import java.util.List; +import java.util.stream.Stream; import org.junit.Before; import org.junit.Test; @@ -82,6 +83,17 @@ public class CustomerRepositoryIntegrationTest { assertThat(result.get(1), is(oliver)); } + /** + * Test case to show the usage of Java {@link Stream}. + */ + @Test + public void findCustomersAsStream() { + + try (Stream result = repository.findAllByCustomQueryWithStream()) { + result.forEach(System.out::println); + } + } + /** * Test case to show the usage of the geo-spatial APIs to lookup people within a given distance of a reference point. */ diff --git a/mongodb/java8/README.md b/mongodb/java8/README.md deleted file mode 100644 index 18883f71..00000000 --- a/mongodb/java8/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Spring Data MongoDB - Java 8 examples - -This project contains samples of Java 8 specific features of Spring Data (MongoDB). - -## Support for JDK 8's `Stream` for repository methods - -Repository methods can use a Java 8 `Stream` as a return type which will cause the reading of the results and the to-object-conversion of the `DBObject` to happen while iterating over the stream. - -```java -public interface PersonRepository extends CrudRepository { - - @Override - List findAll(); - - //Custom Query method returning a Java 8 Stream - @Query("{}") - Stream findAllByCustomQueryWithStream(); -} -``` - -The test cases in `PersonRepositoryIntegrationTest` oppose a plain `List` based query method with one that uses a `Stream` and shows how the former pulls all data into memory first and the iteration is done over the pre-populated list. The execution of the `Stream`-based method in contrast shows that the individual elements are read and converted while iterating the stream. diff --git a/mongodb/java8/pom.xml b/mongodb/java8/pom.xml deleted file mode 100644 index a785d912..00000000 --- a/mongodb/java8/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - 4.0.0 - - - org.springframework.data.examples - spring-data-mongodb-examples - 2.0.0.BUILD-SNAPSHOT - - - spring-data-mongodb-java8 - Spring Data MongoDB - Java 8 specific features - - diff --git a/mongodb/java8/src/main/java/example/springdata/mongodb/people/ApplicationConfiguration.java b/mongodb/java8/src/main/java/example/springdata/mongodb/people/ApplicationConfiguration.java deleted file mode 100644 index cebdebc1..00000000 --- a/mongodb/java8/src/main/java/example/springdata/mongodb/people/ApplicationConfiguration.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2015-2021 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package example.springdata.mongodb.people; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.data.mongodb.core.mapping.event.LoggingEventListener; - -/** - * Simple configuration that registers a {@link LoggingEventListener} to demonstrate mapping behaviour when Java 8 - * Streams are used. - * - * @author Thomas Darimont - */ -@SpringBootApplication -class ApplicationConfiguration { - - public @Bean LoggingEventListener mongoEventListener() { - return new LoggingEventListener(); - } -} diff --git a/mongodb/java8/src/main/java/example/springdata/mongodb/people/PersonRepository.java b/mongodb/java8/src/main/java/example/springdata/mongodb/people/PersonRepository.java deleted file mode 100644 index 942cea37..00000000 --- a/mongodb/java8/src/main/java/example/springdata/mongodb/people/PersonRepository.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2015-2021 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package example.springdata.mongodb.people; - -import java.util.List; -import java.util.stream.Stream; - -import org.springframework.data.mongodb.repository.Query; -import org.springframework.data.repository.CrudRepository; - -/** - * Repository interface to manage {@link Person} instances. - * - * @author Thomas Darimont - */ -public interface PersonRepository extends CrudRepository { - - List findAll(); - - @Query("{}") - Stream findAllByCustomQueryWithStream(); -} diff --git a/mongodb/java8/src/test/java/example/springdata/mongodb/people/PersonRepositoryIntegrationTest.java b/mongodb/java8/src/test/java/example/springdata/mongodb/people/PersonRepositoryIntegrationTest.java deleted file mode 100644 index db6f2a7e..00000000 --- a/mongodb/java8/src/test/java/example/springdata/mongodb/people/PersonRepositoryIntegrationTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2015-2021 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package example.springdata.mongodb.people; - -import java.util.stream.Stream; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.data.mongodb.core.MongoOperations; -import org.springframework.data.mongodb.core.mapping.event.LoggingEventListener; -import org.springframework.test.context.junit4.SpringRunner; - -/** - * Integration test for {@link PersonRepository}. - * - * @author Thomas Darimont - * @author Oliver Gierke - */ -@RunWith(SpringRunner.class) -@SpringBootTest -public class PersonRepositoryIntegrationTest { - - @Autowired PersonRepository repository; - @Autowired MongoOperations operations; - - Person dave, oliver, carter; - - @Before - public void setUp() { - - repository.deleteAll(); - - dave = repository.save(new Person("Dave", "Matthews")); - oliver = repository.save(new Person("Oliver August", "Matthews")); - carter = repository.save(new Person("Carter", "Beauford")); - } - - /** - * Note that the all object conversions are preformed before the results are printed to the console. - */ - @Test - public void shouldPerformConversionBeforeResultProcessing() { - repository.findAll().forEach(System.out::println); - } - - /** - * Note that the object conversions are preformed during stream processing as one can see from the - * {@link LoggingEventListener} output that is printed to the console. - */ - @Test - public void shouldPerformConversionDuringJava8StreamProcessing() { - - try (Stream result = repository.findAllByCustomQueryWithStream()) { - result.forEach(System.out::println); - } - } -} diff --git a/mongodb/java8/src/test/java/example/springdata/mongodb/people/package-info.java b/mongodb/java8/src/test/java/example/springdata/mongodb/people/package-info.java deleted file mode 100644 index e4c4d5e2..00000000 --- a/mongodb/java8/src/test/java/example/springdata/mongodb/people/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Package showing usage of Spring Data MongoDB Repositories with Java 8. - */ -package example.springdata.mongodb.people; - diff --git a/mongodb/java8/src/test/resources/application.properties b/mongodb/java8/src/test/resources/application.properties deleted file mode 100644 index c59a689b..00000000 --- a/mongodb/java8/src/test/resources/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -# Random port for embedded MongoDB -spring.data.mongodb.port=0 diff --git a/mongodb/pom.xml b/mongodb/pom.xml index 4dcde8af..ff85fcde 100644 --- a/mongodb/pom.xml +++ b/mongodb/pom.xml @@ -23,7 +23,6 @@ fluent-api geo-json gridfs - java8 jmolecules kotlin query-by-example