use of com.blazebit.persistence.deltaspike.data.KeysetPageRequest in project blaze-persistence by Blazebit.
the class KeysetPageableParamConverterProvider method resolveKeysetPageableConfiguration.
private KeysetPageableConfiguration resolveKeysetPageableConfiguration(KeysetConfig keysetConfig, PageableDefault pageableDefault, List<SortDefault> sortDefaults) {
if (pageableDefault == null && sortDefaults.isEmpty()) {
return keysetPageableConfiguration;
}
KeysetPageableConfigurationImpl keysetPageableConfiguration = new KeysetPageableConfigurationImpl(this.keysetPageableConfiguration);
apply(keysetPageableConfiguration, pageableDefault, sortDefaults);
if (keysetConfig != null) {
if (!keysetConfig.highestName().isEmpty()) {
keysetPageableConfiguration.setHighestParameterName(keysetConfig.highestName());
}
if (!keysetConfig.lowestName().isEmpty()) {
keysetPageableConfiguration.setLowestParameterName(keysetConfig.lowestName());
}
if (!keysetConfig.previousOffsetName().isEmpty()) {
keysetPageableConfiguration.setPreviousOffsetParameterName(keysetConfig.previousOffsetName());
}
if (!keysetConfig.previousPageName().isEmpty()) {
keysetPageableConfiguration.setPreviousPageParameterName(keysetConfig.previousPageName());
}
if (!keysetConfig.previousPageSizeName().isEmpty()) {
keysetPageableConfiguration.setPreviousSizeParameterName(keysetConfig.previousPageSizeName());
}
}
keysetPageableConfiguration.setFallbackPageable(new KeysetPageRequest(null, keysetPageableConfiguration.getFallbackPageable()));
return keysetPageableConfiguration;
}
use of com.blazebit.persistence.deltaspike.data.KeysetPageRequest in project blaze-persistence by Blazebit.
the class FullEntityViewRepositoryTest method testFindAllWithKeysetExtraction.
@Test
public void testFindAllWithKeysetExtraction() {
Pageable pageable = new KeysetPageRequest(null, new Sort("id"), 0, 5, true, true);
Page<PersonView> page = personViewRepository.findAll(pageable);
KeysetAwarePage<PersonView> keysetAwarePage = (KeysetAwarePage<PersonView>) page;
assertEquals(5, keysetAwarePage.getKeysetPage().getKeysets().size());
}
Aggregations