Interface EjemplarRepository

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

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

    Modifier and Type
    Method
    Description
     
     
     

    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

    • findByLibroIdLibro

      List<Ejemplar> findByLibroIdLibro(Long idLibro)
    • countByLibroIdLibro

      Long countByLibroIdLibro(Long idLibro)
    • buscarEjemplaresDisponibles

      @Query(" SELECT e FROM Ejemplar e\n WHERE e.libro.activo = true\n AND e.activo = true AND e.idEjemplar NOT IN (\n SELECT p.ejemplar.idEjemplar\n FROM Prestamo p\n WHERE p.fechaDevolucion IS NULL\n )\n") List<Ejemplar> buscarEjemplaresDisponibles()