#519 - Polishing.
Switch wording to imperative instead of sync. Consistently use interface names. Original pull request: #520.
This commit is contained in:
@@ -29,11 +29,11 @@ We have separate folders for the samples of individual modules:
|
||||
* `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.
|
||||
* `kotlin` - Example for using Cassandra with MongoDB.
|
||||
* `query-by-example` - Example project showing usage of Query by Example with MongoDB.
|
||||
* `querydsl` - Example project showing sync/reactive [Querydsl](https://github.com/querydsl/querydsl) support for MongoDB.
|
||||
* `querydsl` - Example project showing imperative and reactive [Querydsl](https://github.com/querydsl/querydsl) support for MongoDB.
|
||||
* `reactive` - Example project to show reactive template and repository support.
|
||||
* `security` - Example project showing usage of Spring Security with MongoDB.
|
||||
* `text-search` - Example project showing usage of MongoDB text search feature.
|
||||
* `transactions` - Example project for synchronous and reactive MongoDB 4.0 transaction support.
|
||||
* `transactions` - Example project for imperative and reactive MongoDB 4.0 transaction support.
|
||||
|
||||
## Spring Data REST
|
||||
|
||||
|
||||
@@ -7,13 +7,13 @@ Spring Data integrates with Querydsl via `QuerydslPredicateExecutor` and its rea
|
||||
|
||||
**NOTE**: You may have to run `mvn compile` to generate the required `Q` classes first.
|
||||
|
||||
## Sync
|
||||
## Imperative
|
||||
|
||||
```java
|
||||
interface SyncCustomerRepository
|
||||
interface CustomerQuerydslRepository
|
||||
extends CrudRepository<Customer, String>, QuerydslPredicateExecutor<Customer> { }
|
||||
|
||||
@Autowired SyncCustomerRepository repository;
|
||||
@Autowired CustomerQuerydslRepository repository;
|
||||
|
||||
// ...
|
||||
|
||||
@@ -23,10 +23,10 @@ List<Customer> result = repository.findAll(QCustomer.customer.lastname.eq("Matth
|
||||
## Reactive
|
||||
|
||||
```java
|
||||
interface ReactiveCustomerRepository
|
||||
interface ReactiveCustomerQuerydslRepository
|
||||
extends ReactiveCrudRepository<Customer, String>, ReactiveQuerydslPredicateExecutor<Customer> { }
|
||||
|
||||
@Autowired ReactiveCustomerRepository repository;
|
||||
@Autowired ReactiveCustomerQuerydslRepository repository;
|
||||
|
||||
// ...
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package example.springdata.mongodb.sync;
|
||||
package example.springdata.mongodb.imperative;
|
||||
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package example.springdata.mongodb.sync;
|
||||
package example.springdata.mongodb.imperative;
|
||||
|
||||
import example.springdata.mongodb.Customer;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package example.springdata.mongodb.sync;
|
||||
package example.springdata.mongodb.imperative;
|
||||
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
@@ -23,6 +23,7 @@ import example.springdata.mongodb.QCustomer;
|
||||
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;
|
||||
@@ -21,9 +21,12 @@ import example.springdata.mongodb.Customer;
|
||||
import example.springdata.mongodb.QCustomer;
|
||||
import reactor.test.StepVerifier;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
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;
|
||||
@@ -50,9 +53,7 @@ public class ReactiveCustomerRepositoryTests {
|
||||
oliver = new Customer("Oliver August", "Matthews");
|
||||
carter = new Customer("Carter", "Beauford");
|
||||
|
||||
repository.save(dave).then().as(StepVerifier::create).verifyComplete();
|
||||
repository.save(oliver).then().as(StepVerifier::create).verifyComplete();
|
||||
repository.save(carter).then().as(StepVerifier::create).verifyComplete();
|
||||
repository.saveAll(Arrays.asList(dave, oliver, carter)).then().as(StepVerifier::create).verifyComplete();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package example.springdata.mongodb.sync;
|
||||
package example.springdata.mongodb.imperative;
|
||||
|
||||
import example.springdata.mongodb.Process;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package example.springdata.mongodb.sync;
|
||||
package example.springdata.mongodb.imperative;
|
||||
|
||||
import example.springdata.mongodb.Process;
|
||||
import example.springdata.mongodb.State;
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package example.springdata.mongodb.sync;
|
||||
package example.springdata.mongodb.imperative;
|
||||
|
||||
import example.springdata.mongodb.Process;
|
||||
import example.springdata.mongodb.State;
|
||||
@@ -35,7 +35,6 @@ import org.springframework.data.mongodb.MongoTransactionManager;
|
||||
import org.springframework.data.mongodb.config.AbstractMongoConfiguration;
|
||||
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
Reference in New Issue
Block a user