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 TypeMethodDescriptionorg.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) existsByIsbn(String isbn) findByIsbn(String isbn) Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods 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
-
countByActivoTrue
Long countByActivoTrue() -
findByIsbn
-
existsByIsbn
-