Доделана пагинация в стримах

This commit is contained in:
serega6531
2019-05-01 19:53:29 +03:00
parent bb517516e1
commit b4a9903d1b
3 changed files with 59 additions and 18 deletions

View File

@@ -1,12 +1,22 @@
package ru.serega6531.packmate.repository;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import ru.serega6531.packmate.model.CtfService;
import ru.serega6531.packmate.model.Stream;
import java.util.List;
public interface StreamRepository extends JpaRepository<Stream, Long> {
List<Stream> findAllByService_Port(int port);
List<Stream> findAllByIdGreaterThan(long streamId, Pageable pageable);
List<Stream> findAllByIdLessThan(long streamId, Pageable pageable);
List<Stream> findAllByService(CtfService service, Pageable pageable);
List<Stream> findAllByServiceAndIdGreaterThan(CtfService service, long streamId, Pageable pageable);
List<Stream> findAllByServiceAndIdLessThan(CtfService service, long streamId, Pageable pageable);
}