Interface AccountEventRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<AccountEvent,,AccountEvent.Id> org.springframework.data.jpa.repository.JpaRepository<AccountEvent,,AccountEvent.Id> org.springframework.data.repository.ListCrudRepository<AccountEvent,,AccountEvent.Id> org.springframework.data.repository.ListPagingAndSortingRepository<AccountEvent,,AccountEvent.Id> org.springframework.data.repository.PagingAndSortingRepository<AccountEvent,,AccountEvent.Id> org.springframework.data.repository.query.QueryByExampleExecutor<AccountEvent>,org.springframework.data.repository.Repository<AccountEvent,AccountEvent.Id>
public interface AccountEventRepository
extends org.springframework.data.jpa.repository.JpaRepository<AccountEvent,AccountEvent.Id>
-
Method Summary
Modifier and TypeMethodDescriptionfindAllByOrganisationId(String organisationId) findByIdAndActive(AccountEvent.Id Id, boolean active) findByOrgIdAndDebitReferenceCodeAndCreditReferenceCode(String orgId, String debitReferenceCode, String creditReferenceCode) findByOrgIdAndRefCodeAccount(String orgId, String referenceCode) Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findAllByOrganisationId
@Query("SELECT a FROM AccountEvent a WHERE a.id.organisationId = :organisationId") Set<AccountEvent> findAllByOrganisationId(@Param("organisationId") String organisationId) -
findByOrgIdAndDebitReferenceCodeAndCreditReferenceCode
@Query("SELECT rc FROM AccountEvent rc WHERE rc.id.organisationId = :orgId AND rc.id.debitReferenceCode = :debitReferenceCode AND rc.id.creditReferenceCode = :creditReferenceCode") Optional<AccountEvent> findByOrgIdAndDebitReferenceCodeAndCreditReferenceCode(@Param("orgId") String orgId, @Param("debitReferenceCode") String debitReferenceCode, @Param("creditReferenceCode") String creditReferenceCode) -
findByIdAndActive
@Query("SELECT av FROM AccountEvent av WHERE av.id = :Id AND av.active = :active AND av.Id.debitReferenceCode = (SELECT rc.Id.referenceCode FROM ReferenceCode rc WHERE rc.isActive = true AND rc.Id.referenceCode = av.Id.debitReferenceCode) AND av.Id.creditReferenceCode = (SELECT rc.Id.referenceCode FROM ReferenceCode rc WHERE rc.isActive = true AND rc.Id.referenceCode = av.Id.creditReferenceCode)") Optional<AccountEvent> findByIdAndActive(@Param("Id") AccountEvent.Id Id, @Param("active") boolean active) -
findByOrgIdAndRefCodeAccount
@Query("SELECT rc FROM AccountEvent rc WHERE rc.id.organisationId = :orgId AND (rc.id.debitReferenceCode = :referenceCode OR rc.id.creditReferenceCode = :referenceCode)") List<AccountEvent> findByOrgIdAndRefCodeAccount(@Param("orgId") String orgId, @Param("referenceCode") String referenceCode)
-