Interface CalendarInstanceRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<org.apache.fineract.portfolio.calendar.domain.CalendarInstance,Long>, org.springframework.data.jpa.repository.JpaRepository<org.apache.fineract.portfolio.calendar.domain.CalendarInstance,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<org.apache.fineract.portfolio.calendar.domain.CalendarInstance>, org.springframework.data.repository.ListCrudRepository<org.apache.fineract.portfolio.calendar.domain.CalendarInstance,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<org.apache.fineract.portfolio.calendar.domain.CalendarInstance,Long>, org.springframework.data.repository.PagingAndSortingRepository<org.apache.fineract.portfolio.calendar.domain.CalendarInstance,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<org.apache.fineract.portfolio.calendar.domain.CalendarInstance>, org.springframework.data.repository.Repository<org.apache.fineract.portfolio.calendar.domain.CalendarInstance,Long>

@Repository @CacheConfig(cacheNames="calendarInstances") public interface CalendarInstanceRepository extends org.springframework.data.jpa.repository.JpaRepository<org.apache.fineract.portfolio.calendar.domain.CalendarInstance,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<org.apache.fineract.portfolio.calendar.domain.CalendarInstance>
  • Method Summary

    Modifier and Type
    Method
    Description
    countOfLoansSyncedWithCalendar(Long calendarId, Collection<org.apache.fineract.portfolio.loanaccount.domain.LoanStatus> loanStatuses)
    EntityType = 3 is for loan
    void
    delete(org.apache.fineract.portfolio.calendar.domain.CalendarInstance entity)
     
    void
     
    void
    deleteAll(Iterable<? extends org.apache.fineract.portfolio.calendar.domain.CalendarInstance> entities)
     
    void
    deleteAllById(Iterable<? extends Long> ids)
     
    void
     
    org.apache.fineract.portfolio.calendar.domain.CalendarInstance
    findByCalendarIdAndEntityIdAndEntityTypeId(Long calendarId, Long entityId, Integer entityTypeId)
     
    Collection<org.apache.fineract.portfolio.calendar.domain.CalendarInstance>
    findByCalendarIdAndEntityTypeId(Long calendarId, Integer entityTypeId)
     
    Collection<org.apache.fineract.portfolio.calendar.domain.CalendarInstance>
    findByEntityIdAndEntityTypeId(Long entityId, Integer entityTypeId)
     
    org.apache.fineract.portfolio.calendar.domain.CalendarInstance
    findByEntityIdAndEntityTypeIdAndCalendarTypeId(Long entityId, Integer entityTypeId, Integer calendarTypeId)
     
    org.apache.fineract.portfolio.calendar.domain.CalendarInstance
    findCalendarInstanceByEntityId(Long entityId, Integer entityTypeId)
     
    List<org.apache.fineract.portfolio.calendar.domain.CalendarInstance>
    findCalendarInstancesForLoansByGroupIdAndClientIdAndStatuses(Long groupId, Long clientId, Collection<org.apache.fineract.portfolio.loanaccount.domain.LoanStatus> loanStatuses)
    Should use in clause, can I do it without creating a new class?
    <S extends org.apache.fineract.portfolio.calendar.domain.CalendarInstance>
    S
    save(S entity)
     
    <S extends org.apache.fineract.portfolio.calendar.domain.CalendarInstance>
    List<S>
    saveAll(Iterable<S> entities)
     
    <S extends org.apache.fineract.portfolio.calendar.domain.CalendarInstance>
    S
    saveAndFlush(S entity)
     

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, existsById, findById

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush

    Methods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor

    count, delete, exists, findAll, findAll, findAll, findBy, findOne

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById

    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

    • findByCalendarIdAndEntityIdAndEntityTypeId

      @Cacheable(key="\'calId_\' + #calendarId + \'_entityId_\' + #entityId + \'_entityTypeId_\' + #entityTypeId") org.apache.fineract.portfolio.calendar.domain.CalendarInstance findByCalendarIdAndEntityIdAndEntityTypeId(Long calendarId, Long entityId, Integer entityTypeId)
    • findByEntityIdAndEntityTypeId

      @Cacheable(key="\'entityId_\' + #entityId + \'_entityTypeId_\' + #entityTypeId") Collection<org.apache.fineract.portfolio.calendar.domain.CalendarInstance> findByEntityIdAndEntityTypeId(Long entityId, Integer entityTypeId)
    • findByEntityIdAndEntityTypeIdAndCalendarTypeId

      @Cacheable(key="\'entityId_\' + #entityId + \'_entityTypeId_\' + #entityTypeId + \'_calendarTypeId_\' + #calendarTypeId") org.apache.fineract.portfolio.calendar.domain.CalendarInstance findByEntityIdAndEntityTypeIdAndCalendarTypeId(Long entityId, Integer entityTypeId, Integer calendarTypeId)
      Parameters:
      entityId - : Id of Client, Group, Loan or SavingsAccount.
      entityTypeId - : CalendarEntityType
      calendarTypeId - : CalendarType
      Returns:
    • findCalendarInstanceByEntityId

      @Cacheable(key="\'findCalendarInstanceByEntityId_entityId_\' + #entityId + \'_entityTypeId_\' + #entityTypeId") @Query("select ci from CalendarInstance ci where ci.entityId = :entityId and ci.entityTypeId = :entityTypeId") org.apache.fineract.portfolio.calendar.domain.CalendarInstance findCalendarInstanceByEntityId(@Param("entityId") Long entityId, @Param("entityTypeId") Integer entityTypeId)
    • findByCalendarIdAndEntityTypeId

      @Cacheable(key="\'calendarId_\' + #calendarId + \'_entityTypeId_\' + #entityTypeId") Collection<org.apache.fineract.portfolio.calendar.domain.CalendarInstance> findByCalendarIdAndEntityTypeId(Long calendarId, Integer entityTypeId)
    • findCalendarInstancesForLoansByGroupIdAndClientIdAndStatuses

      @Cacheable(key="\'groupId_\' + #groupId + \'_clientId_\' + #clientId + \'_statuses_\' + T(org.springframework.util.StringUtils).collectionToCommaDelimitedString(#loanStatuses)") @Query("select ci from CalendarInstance ci where ci.entityId in (select loan.id from Loan loan where loan.client.id = :clientId and loan.group.id = :groupId and loan.loanStatus in :loanStatuses) and ci.entityTypeId = 3") List<org.apache.fineract.portfolio.calendar.domain.CalendarInstance> findCalendarInstancesForLoansByGroupIdAndClientIdAndStatuses(@Param("groupId") Long groupId, @Param("clientId") Long clientId, @Param("loanStatuses") Collection<org.apache.fineract.portfolio.loanaccount.domain.LoanStatus> loanStatuses)
      Should use in clause, can I do it without creating a new class?
    • countOfLoansSyncedWithCalendar

      @Cacheable(key="\'countLoans_calendarId_\' + #calendarId + \'_statuses_\' + T(org.springframework.util.StringUtils).collectionToCommaDelimitedString(#loanStatuses)") @Query("SELECT COUNT(ci.id) FROM CalendarInstance ci, Loan loan WHERE loan.id = ci.entityId AND ci.entityTypeId = 3 AND ci.calendar.id = :calendarId AND loan.loanStatus IN :loanStatuses ") Integer countOfLoansSyncedWithCalendar(@Param("calendarId") Long calendarId, @Param("loanStatuses") Collection<org.apache.fineract.portfolio.loanaccount.domain.LoanStatus> loanStatuses)
      EntityType = 3 is for loan
    • save

      @CacheEvict(allEntries=true) <S extends org.apache.fineract.portfolio.calendar.domain.CalendarInstance> S save(S entity)
      Specified by:
      save in interface org.springframework.data.repository.CrudRepository<org.apache.fineract.portfolio.calendar.domain.CalendarInstance,Long>
    • saveAll

      @CacheEvict(allEntries=true) <S extends org.apache.fineract.portfolio.calendar.domain.CalendarInstance> List<S> saveAll(Iterable<S> entities)
      Specified by:
      saveAll in interface org.springframework.data.repository.CrudRepository<org.apache.fineract.portfolio.calendar.domain.CalendarInstance,Long>
      Specified by:
      saveAll in interface org.springframework.data.repository.ListCrudRepository<org.apache.fineract.portfolio.calendar.domain.CalendarInstance,Long>
    • delete

      @CacheEvict(allEntries=true) void delete(org.apache.fineract.portfolio.calendar.domain.CalendarInstance entity)
      Specified by:
      delete in interface org.springframework.data.repository.CrudRepository<org.apache.fineract.portfolio.calendar.domain.CalendarInstance,Long>
    • deleteById

      @CacheEvict(allEntries=true) void deleteById(Long id)
      Specified by:
      deleteById in interface org.springframework.data.repository.CrudRepository<org.apache.fineract.portfolio.calendar.domain.CalendarInstance,Long>
    • deleteAll

      @CacheEvict(allEntries=true) void deleteAll()
      Specified by:
      deleteAll in interface org.springframework.data.repository.CrudRepository<org.apache.fineract.portfolio.calendar.domain.CalendarInstance,Long>
    • deleteAll

      @CacheEvict(allEntries=true) void deleteAll(Iterable<? extends org.apache.fineract.portfolio.calendar.domain.CalendarInstance> entities)
      Specified by:
      deleteAll in interface org.springframework.data.repository.CrudRepository<org.apache.fineract.portfolio.calendar.domain.CalendarInstance,Long>
    • deleteAllById

      @CacheEvict(allEntries=true) void deleteAllById(Iterable<? extends Long> ids)
      Specified by:
      deleteAllById in interface org.springframework.data.repository.CrudRepository<org.apache.fineract.portfolio.calendar.domain.CalendarInstance,Long>
    • saveAndFlush

      @CacheEvict(allEntries=true) <S extends org.apache.fineract.portfolio.calendar.domain.CalendarInstance> S saveAndFlush(S entity)
      Specified by:
      saveAndFlush in interface org.springframework.data.jpa.repository.JpaRepository<org.apache.fineract.portfolio.calendar.domain.CalendarInstance,Long>