| package org.eclipse.openk.contactbasedata.repository; |
| |
| import org.eclipse.openk.contactbasedata.model.VwDetailedContact; |
| import org.springframework.data.domain.Page; |
| import org.springframework.data.domain.Pageable; |
| import org.springframework.data.jpa.repository.Query; |
| import org.springframework.data.repository.PagingAndSortingRepository; |
| |
| import java.util.UUID; |
| |
| public interface DetailedContactRepository extends PagingAndSortingRepository<VwDetailedContact, Long> { |
| Page<VwDetailedContact> findAll(Pageable pageable); |
| |
| |
| @Query( "select dc from VwDetailedContact dc where" |
| + "(COALESCE(?1) is null or COALESCE(?1) is not null AND dc.contactType=?1)" |
| + " and (COALESCE(?2) is null or COALESCE(?2) is not null AND dc.personTypeUuid=?2)" |
| + " and (COALESCE(?3) is null or COALESCE(?3) is not null AND dc.searchfield like %?3%)") |
| Page<VwDetailedContact> findByFilter(String contactType, UUID personType, String searchText, Pageable pageable); |
| } |