@Repository public interface ShiftRepository extends org.springframework.data.jpa.repository.JpaRepository<Shift,Long>
| Modifier and Type | Method and Description |
|---|---|
void |
deleteForTenant(Integer tenantId) |
List<Shift> |
filterWithEmployees(Integer tenantId,
Set<Employee> employeeSet,
OffsetDateTime startDateTime,
OffsetDateTime endDateTime) |
List<Shift> |
filterWithSpots(Integer tenantId,
Set<Spot> spotSet,
OffsetDateTime startDateTime,
OffsetDateTime endDateTime) |
List<Shift> |
findAllByTenantId(Integer tenantId) |
deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getOne, saveAll, saveAndFlushfindAll@Query(value="select distinct sa from Shift sa left join fetch sa.spot s left join fetch sa.rotationEmployee re left join fetch sa.employee e where sa.tenantId = :tenantId order by sa.startDateTime, s.name, e.name") List<Shift> findAllByTenantId(@Param(value="tenantId") Integer tenantId)
@Modifying(flushAutomatically=true,
clearAutomatically=true)
@Query(value="delete from Shift s where s.tenantId = :tenantId")
void deleteForTenant(@Param(value="tenantId")
Integer tenantId)
@Query(value="select distinct sa from Shift sa left join fetch sa.spot s left join fetch sa.rotationEmployee re left join fetch sa.employee e where sa.tenantId = :tenantId and sa.spot IN :spotSet and sa.endDateTime >= :startDateTime and sa.startDateTime < :endDateTime order by sa.startDateTime, s.name, e.name") List<Shift> filterWithSpots(@Param(value="tenantId") Integer tenantId, @Param(value="spotSet") Set<Spot> spotSet, @Param(value="startDateTime") OffsetDateTime startDateTime, @Param(value="endDateTime") OffsetDateTime endDateTime)
@Query(value="select distinct sa from Shift sa left join fetch sa.spot s left join fetch sa.rotationEmployee re left join fetch sa.employee e where sa.tenantId = :tenantId and sa.employee IN :employeeSet and sa.endDateTime >= :startDateTime and sa.startDateTime < :endDateTime order by sa.startDateTime, s.name, e.name") List<Shift> filterWithEmployees(@Param(value="tenantId") Integer tenantId, @Param(value="employeeSet") Set<Employee> employeeSet, @Param(value="startDateTime") OffsetDateTime startDateTime, @Param(value="endDateTime") OffsetDateTime endDateTime)
Copyright © 2017–2019 JBoss by Red Hat. All rights reserved.