Files
spring-data-examples/mongodb/querydsl
Mark Paluch b9da3dde1e #519 - Polishing.
Switch wording to imperative instead of sync. Consistently use interface names.

Original pull request: #520.
2019-08-13 12:10:47 +02:00
..
2019-08-13 12:10:47 +02:00
2019-08-13 12:10:47 +02:00

Spring Data MongoDB - Querydsl example

This project contains samples of Querydsl usage in Spring Data MongoDB.

Querydsl is a framework which enables the construction of fluent, type-safe queries for multiple backends including MongoDB. Spring Data integrates with Querydsl via QuerydslPredicateExecutor and its reactive counterpart ReactiveQuerydslPredicateExecutor.

NOTE: You may have to run mvn compile to generate the required Q classes first.

Imperative

interface CustomerQuerydslRepository 
        extends CrudRepository<Customer, String>, QuerydslPredicateExecutor<Customer> { }

@Autowired CustomerQuerydslRepository repository;

// ...

List<Customer> result = repository.findAll(QCustomer.customer.lastname.eq("Matthews"));

Reactive

interface ReactiveCustomerQuerydslRepository
		extends ReactiveCrudRepository<Customer, String>, ReactiveQuerydslPredicateExecutor<Customer> { }
		
@Autowired ReactiveCustomerQuerydslRepository repository;

// ...

Flux<Customer> result = repository.findAll(QCustomer.customer.lastname.eq("Matthews"));