Package it.univr.passportease.repository
Interface RequestRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Request,
,UUID> org.springframework.data.jpa.repository.JpaRepository<Request,
,UUID> org.springframework.data.repository.ListCrudRepository<Request,
,UUID> org.springframework.data.repository.ListPagingAndSortingRepository<Request,
,UUID> org.springframework.data.repository.PagingAndSortingRepository<Request,
,UUID> org.springframework.data.repository.query.QueryByExampleExecutor<Request>
,org.springframework.data.repository.Repository<Request,
UUID>
@Repository
public interface RequestRepository
extends org.springframework.data.jpa.repository.JpaRepository<Request,UUID>
Repository for the
Request
entity.-
Method Summary
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
-
getOfficeRequests
@Query(value="SELECT r.id, r.duration, r.start_date, r.end_date, r.start_time, r.end_time, r.worker_id, r.request_type_id, r.created_at, r.updated_at FROM requests r, requests_offices ro, offices o WHERE r.id = ro.request_id AND ro.office_id = o.id AND ro.office_id = :officeId AND r.start_date >= :startDate AND r.start_date <= :endDate", nativeQuery=true) List<Request> getOfficeRequests(@Param("officeId") UUID officeId, @Param("startDate") Date startDate, @Param("endDate") Date endDate) Finds all theRequest
associated to the given worker id.- Parameters:
officeId
- office id to search forstartDate
- start date to search forendDate
- end date to search for- Returns:
- a list of
Request
objects.
-