Search in sources :

Example 1 with StudySpecification

use of com.odysseusinc.arachne.portal.model.search.StudySpecification in project ArachneCentralAPI by OHDSI.

the class BaseStudyServiceImpl method findStudies.

@Override
@Transactional(readOnly = true)
public Page<AbstractUserStudyListItem> findStudies(final SS studySearch) {
    Sort sort = getSort(studySearch.getSortBy(), studySearch.getSortAsc());
    StudySpecification<SU> studyFilteredListSpecification = new StudySpecification<>(studySearch);
    Page<SU> resultPage = baseUserStudyLinkRepository.findAll(studyFilteredListSpecification, PageRequest.of(studySearch.getPage() - 1, studySearch.getPagesize(), sort));
    return resultPage.map(s -> (AbstractUserStudyListItem) s);
}
Also used : StudySpecification(com.odysseusinc.arachne.portal.model.search.StudySpecification) Sort(org.springframework.data.domain.Sort) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

StudySpecification (com.odysseusinc.arachne.portal.model.search.StudySpecification)1 Sort (org.springframework.data.domain.Sort)1 Transactional (org.springframework.transaction.annotation.Transactional)1