Interface LibroRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Libro,Long>, org.springframework.data.jpa.repository.JpaRepository<Libro,Long>, org.springframework.data.repository.ListCrudRepository<Libro,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<Libro,Long>, org.springframework.data.repository.PagingAndSortingRepository<Libro,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<Libro>, org.springframework.data.repository.Repository<Libro,Long>

@Repository public interface LibroRepository extends org.springframework.data.jpa.repository.JpaRepository<Libro,Long>
Author:
Usuario
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.data.domain.Page<Libro>
    buscarLibros(String busqueda, Boolean activo, org.springframework.data.domain.Pageable pageable)
     
    org.springframework.data.domain.Page<Libro>
    buscarTodosLibros(String busqueda, org.springframework.data.domain.Pageable pageable)
     
     
     
     
     

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

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

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

    findAll, findAllById, saveAll

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

    findAll

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

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • buscarLibros

      @Query(" SELECT l FROM Libro l\n WHERE (:busqueda IS NULL OR :busqueda = \'\'\n OR LOWER(l.titulo) LIKE LOWER(CONCAT(\'%\', :busqueda, \'%\'))\n OR l.isbn LIKE CONCAT(\'%\', :busqueda, \'%\'))\n AND (:activo IS NULL OR l.activo = :activo)\n") org.springframework.data.domain.Page<Libro> buscarLibros(@Param("busqueda") String busqueda, @Param("activo") Boolean activo, org.springframework.data.domain.Pageable pageable)
    • buscarTodosLibros

      @Query(" SELECT l FROM Libro l\n WHERE (:busqueda IS NULL OR :busqueda = \'\')\n OR LOWER(l.titulo) LIKE LOWER(CONCAT(\'%\', :busqueda, \'%\'))\n OR LOWER(l.isbn) LIKE LOWER(CONCAT(\'%\', :busqueda, \'%\'))\n") org.springframework.data.domain.Page<Libro> buscarTodosLibros(@Param("busqueda") String busqueda, org.springframework.data.domain.Pageable pageable)
    • findByIsbnContainingAndActivoTrue

      List<Libro> findByIsbnContainingAndActivoTrue(String isbn)
    • countByActivoTrue

      Long countByActivoTrue()
    • findByIsbn

      Libro findByIsbn(String isbn)
    • existsByIsbn

      Boolean existsByIsbn(String isbn)