Interface CarRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Car,Long>, org.springframework.data.repository.PagingAndSortingRepository<Car,Long>, org.springframework.data.repository.Repository<Car,Long>

public interface CarRepository extends org.springframework.data.repository.PagingAndSortingRepository<Car,Long>, org.springframework.data.repository.CrudRepository<Car,Long>
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.data.domain.Page<Car>
    findAll(org.springframework.data.domain.Pageable pageable, String name, Long minPrice, Long maxPrice)
     

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAllById, findById, save, saveAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll, findAll
  • Method Details

    • findAll

      @Query("SELECT s FROM Car s WHERE (:name is null or name LIKE \'%\' || :name || \'%\') and (:minPrice is null or s.price >= :minPrice) and (:maxPrice is null or s.price <= :maxPrice)") org.springframework.data.domain.Page<Car> findAll(org.springframework.data.domain.Pageable pageable, @Param("name") String name, @Param("minPrice") Long minPrice, @Param("maxPrice") Long maxPrice)