Interface DelegationRepo

All Superinterfaces:
org.springframework.data.repository.CrudRepository<JPADelegation,String>, DAO<Delegation>, DelegationDAO, org.springframework.data.repository.ListCrudRepository<JPADelegation,String>, org.springframework.data.repository.Repository<JPADelegation,String>

public interface DelegationRepo extends org.springframework.data.repository.ListCrudRepository<JPADelegation,String>, DelegationDAO
  • Method Details

    • findValidFor

      @Query("SELECT e.id FROM #{#entityName} e WHERE e.delegating.id = :delegating AND e.delegated.id = :delegated AND e.startDate <= :now AND (e.endDate IS NULL OR e.endDate >= :now)") Optional<String> findValidFor(@Param("delegating") String delegating, @Param("delegated") String delegated, @Param("now") OffsetDateTime now)
      Specified by:
      findValidFor in interface DelegationDAO
    • findValidDelegating

      @Query("SELECT e.delegating.username FROM #{#entityName} e WHERE e.delegated.id = :delegated AND e.startDate <= :now AND (e.endDate IS NULL OR e.endDate >= :now)") List<String> findValidDelegating(@Param("delegated") String delegated, @Param("now") OffsetDateTime now)
      Specified by:
      findValidDelegating in interface DelegationDAO