use of de.spring.example.persistence.domain.QAdDescription in project JavaForFun by gumartinm.
the class AdDescriptionServiceImpl method queryDslExample.
// Extending CrudServiceImpl when we need some business logic. Otherwise we would be using
// the JPA repositories and nothing else :)
// In this case there is any business logic, but this is just an example.
/**
* Using Querydsl. Giving some business logic to this service :)
*
* Querydsl: fluent interface done easy. There is no effort because it is already implemented.
*
* Criteria using Specifications requires some effort.
*
* See: de.spring.example.services.impl.AdServiceImpl
*/
@Override
public Page<AdDescription> queryDslExample(Pageable pageRequest) {
final QAdDescription adDescription = QAdDescription.adDescription1;
final BooleanExpression adDescriptionHasAdLink = adDescription.adLink.contains("gumartinm");
final BooleanExpression adDescriptionHasDescription = adDescription.adDescription.contains("babucha");
/**
* https://github.com/spring-projects/spring-data-envers/pull/45
* return repository.findAll(adDescriptionHasAdLink.and(adDescriptionHasDescription), pageRequest);
*/
return null;
}
Aggregations