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 Type
    Method
    Description
    org.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)
     
     
     
     

    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

    • findByEjemplarCodigoContainingIgnoreCase

      List<Prestamo> findByEjemplarCodigoContainingIgnoreCase(String codigoEjemplar)
    • findByUsuarioIdUsuario

      List<Prestamo> findByUsuarioIdUsuario(Long idUsuario)
    • 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

      Long countByEstadoPrestamoIn(List<EstadoPrestamo> estados)