February 2019
Intermediate to advanced
442 pages
11h 46m
English
In the service layer, JHipster generates a separate class as xxxQueryService, under the service package. For the Country entity, a new service class, CountryQueryService, is created. The purpose of this class is to retrieve the data with the filtering criteria, so it contains only fetch methods, which look as follows:
public Page<CountryDTO> findByCriteria(CountryCriteria criteria, Pageable page) { log.debug("find by criteria : {}, page: {}", criteria, page); final Specification<Country> specification = createSpecification(criteria); return countryRepository.findAll(specification, page) .map(countryMapper::toDto); }
JHipster generates a Plain Old Java Object (POJO) class for each entity that is declared with the filter ...