Interface ConsentJpaRepository
-
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<ConsentEntity,Long>,org.springframework.data.jpa.repository.JpaSpecificationExecutor<ConsentEntity>,org.springframework.data.repository.Repository<ConsentEntity,Long>
public interface ConsentJpaRepository extends org.springframework.data.repository.CrudRepository<ConsentEntity,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<ConsentEntity>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LongcountByConsentStatusIn(Set<de.adorsys.psd2.xs2a.core.consent.ConsentStatus> statuses)voidexpireByConsentStatusIn(Set<de.adorsys.psd2.xs2a.core.consent.ConsentStatus> consentStatuses)voidexpireUsedNonRecurringConsents(Set<de.adorsys.psd2.xs2a.core.consent.ConsentStatus> consentStatuses)List<ConsentEntity>findAllByExternalIdIn(List<String> externalIds)org.springframework.data.domain.Page<ConsentEntity>findAllWithPagination(Set<String> consentType, String aspspAccountId, OffsetDateTime createDateFrom, OffsetDateTime createDateTo, String instanceId, org.springframework.data.domain.Pageable pageable)org.springframework.data.domain.Page<ConsentEntity>findAllWithPaginationAndTppInfo(Set<String> consentType, String aspspAccountId, OffsetDateTime createDateFrom, OffsetDateTime createDateTo, String instanceId, org.springframework.data.domain.Pageable pageable, String additionalTppInfo)List<ConsentEntity>findByConsentStatusIn(Set<de.adorsys.psd2.xs2a.core.consent.ConsentStatus> statuses, org.springframework.data.domain.Pageable pageable)Optional<ConsentEntity>findByExternalId(String externalId)List<ConsentEntity>findOldConsentsByNewConsentParams(Set<String> psuIds, String tppAuthorisationNumber, String instanceId, String newConsentId, Set<de.adorsys.psd2.xs2a.core.consent.ConsentStatus> consentStatuses)
-
-
-
Method Detail
-
findByConsentStatusIn
List<ConsentEntity> findByConsentStatusIn(Set<de.adorsys.psd2.xs2a.core.consent.ConsentStatus> statuses, org.springframework.data.domain.Pageable pageable)
-
countByConsentStatusIn
Long countByConsentStatusIn(Set<de.adorsys.psd2.xs2a.core.consent.ConsentStatus> statuses)
-
findByExternalId
Optional<ConsentEntity> findByExternalId(String externalId)
-
findAllByExternalIdIn
List<ConsentEntity> findAllByExternalIdIn(List<String> externalIds)
-
expireByConsentStatusIn
@Query("UPDATE consent SET consentStatus = \'EXPIRED\', expireDate = CURRENT_TIMESTAMP WHERE consentStatus IN :consentStatuses AND validUntil < CURRENT_DATE") @Modifying void expireByConsentStatusIn(@Param("consentStatuses") Set<de.adorsys.psd2.xs2a.core.consent.ConsentStatus> consentStatuses)
-
findOldConsentsByNewConsentParams
@Query("select c from consent c join c.psuDataList psuList where psuList.psuId in :psuIds and c.tppInformation.tppInfo.authorisationNumber = :authorisationNumber and c.instanceId = :instanceId and c.consentStatus in :consentStatuses and c.externalId <> :newConsentId") List<ConsentEntity> findOldConsentsByNewConsentParams(@Param("psuIds") Set<String> psuIds, @Param("authorisationNumber") String tppAuthorisationNumber, @Param("instanceId") String instanceId, @Param("newConsentId") String newConsentId, @Param("consentStatuses") Set<de.adorsys.psd2.xs2a.core.consent.ConsentStatus> consentStatuses)
-
expireUsedNonRecurringConsents
@Query("UPDATE consent SET consentStatus = \'EXPIRED\', expireDate = CURRENT_TIMESTAMP WHERE recurringIndicator = false AND consentStatus IN :consentStatuses AND id IN (SELECT cu.consent.id FROM consent_usage cu WHERE cu.usageDate < CURRENT_DATE)") @Modifying void expireUsedNonRecurringConsents(@Param("consentStatuses") Set<de.adorsys.psd2.xs2a.core.consent.ConsentStatus> consentStatuses)
-
findAllWithPagination
@Query(value="select * from {h-schema}consent c join (select consent_id cid, aspsp_account_id from {h-schema}aspsp_account_access group by consent_id, aspsp_account_id) a on a.cid = c.consent_id where c.consent_type in :consentType and a.aspsp_account_id = :aspspAccountId and c.creation_timestamp between :createDateFrom and :createDateTo and c.instance_id = :instanceId ", nativeQuery=true) org.springframework.data.domain.Page<ConsentEntity> findAllWithPagination(@Param("consentType") Set<String> consentType, @Param("aspspAccountId") String aspspAccountId, @Param("createDateFrom") OffsetDateTime createDateFrom, @Param("createDateTo") OffsetDateTime createDateTo, @Param("instanceId") String instanceId, org.springframework.data.domain.Pageable pageable)
-
findAllWithPaginationAndTppInfo
@Query(value="select * from {h-schema}consent c join (select consent_id cid, aspsp_account_id from {h-schema}aspsp_account_access group by consent_id, aspsp_account_id) a on a.cid = c.consent_id join (select consent_tpp_information_id tid, additional_info from {h-schema}consent_tpp_information) t on t.tid = c.consent_tpp_information_id where c.consent_type in :consentType and a.aspsp_account_id = :aspspAccountId and c.creation_timestamp between :createDateFrom and :createDateTo and c.instance_id = :instanceId and t.additional_info = :additionalTppInfo", nativeQuery=true) org.springframework.data.domain.Page<ConsentEntity> findAllWithPaginationAndTppInfo(@Param("consentType") Set<String> consentType, @Param("aspspAccountId") String aspspAccountId, @Param("createDateFrom") OffsetDateTime createDateFrom, @Param("createDateTo") OffsetDateTime createDateTo, @Param("instanceId") String instanceId, org.springframework.data.domain.Pageable pageable, @Param("additionalTppInfo") String additionalTppInfo)
-
-