Interface PrestamoRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Prestamo,,Long> org.springframework.data.jpa.repository.JpaRepository<Prestamo,,Long> org.springframework.data.repository.ListCrudRepository<Prestamo,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<Prestamo,,Long> org.springframework.data.repository.PagingAndSortingRepository<Prestamo,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<Prestamo>,org.springframework.data.repository.Repository<Prestamo,Long>
@Repository
public interface PrestamoRepository
extends org.springframework.data.jpa.repository.JpaRepository<Prestamo,Long>
- Author:
- Usuario
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.data.domain.Page<Prestamo> buscarPrestamos(String busqueda, EstadoPrestamo estadoPrestamo, org.springframework.data.domain.Pageable pageable) org.springframework.data.domain.Page<Prestamo> buscarTodosPrestamos(String busqueda, org.springframework.data.domain.Pageable pageable) countByEstadoPrestamoIn(List<EstadoPrestamo> estados) findByEjemplarCodigoContainingIgnoreCase(String codigoEjemplar) findByUsuarioIdUsuario(Long idUsuario) 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
-
findByEjemplarCodigoContainingIgnoreCase
-
findByUsuarioIdUsuario
-
buscarTodosPrestamos
@Query("SELECT p FROM Prestamo p WHERE (:busqueda IS NULL\nOR :busqueda = \'\' OR p.ejemplar.codigo LIKE CONCAT(\'%\', :busqueda, \'%\')\nOR LOWER(p.usuario.nombre) LIKE LOWER(CONCAT(\'%\',:busqueda, \'%\')))\n") org.springframework.data.domain.Page<Prestamo> buscarTodosPrestamos(@Param("busqueda") String busqueda, org.springframework.data.domain.Pageable pageable) -
buscarPrestamos
@Query(" SELECT p FROM Prestamo p WHERE (\n :busqueda IS NULL OR :busqueda = \'\'\n OR LOWER(p.usuario.nombre) LIKE LOWER(CONCAT(\'%\', :busqueda, \'%\'))\n OR LOWER(p.ejemplar.codigo) LIKE LOWER(CONCAT(\'%\', :busqueda, \'%\')))\n AND (:estadoPrestamo IS NULL OR p.estadoPrestamo = :estadoPrestamo)\n") org.springframework.data.domain.Page<Prestamo> buscarPrestamos(@Param("busqueda") String busqueda, @Param("estadoPrestamo") EstadoPrestamo estadoPrestamo, org.springframework.data.domain.Pageable pageable) -
countByEstadoPrestamoIn
-