FINERACT-1724: Add missing Params annotations
This commit is contained in:
+2
-1
@@ -23,6 +23,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
public interface CommandSourceRepository extends JpaRepository<CommandSource, Long>, JpaSpecificationExecutor<CommandSource> {
|
||||
|
||||
@@ -30,6 +31,6 @@ public interface CommandSourceRepository extends JpaRepository<CommandSource, Lo
|
||||
|
||||
@Modifying(flushAutomatically = true)
|
||||
@Query("delete from CommandSource c where c.status = :status and c.madeOnDate is not null and c.madeOnDate <= :dateForPurgeCriteria")
|
||||
void deleteOlderEventsWithStatus(Integer status, OffsetDateTime dateForPurgeCriteria);
|
||||
void deleteOlderEventsWithStatus(@Param("status") Integer status, @Param("dateForPurgeCriteria") OffsetDateTime dateForPurgeCriteria);
|
||||
|
||||
}
|
||||
|
||||
+4
-2
@@ -28,6 +28,7 @@ import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
public interface ExternalEventRepository extends JpaRepository<ExternalEvent, Long> {
|
||||
|
||||
@@ -35,9 +36,10 @@ public interface ExternalEventRepository extends JpaRepository<ExternalEvent, Lo
|
||||
|
||||
@Modifying(flushAutomatically = true)
|
||||
@Query("delete from ExternalEvent e where e.status = :status and e.businessDate <= :dateForPurgeCriteria")
|
||||
void deleteOlderEventsWithSentStatus(ExternalEventStatus status, LocalDate dateForPurgeCriteria);
|
||||
void deleteOlderEventsWithSentStatus(@Param("status") ExternalEventStatus status,
|
||||
@Param("dateForPurgeCriteria") LocalDate dateForPurgeCriteria);
|
||||
|
||||
@Modifying
|
||||
@Query("UPDATE ExternalEvent e SET e.status = org.apache.fineract.infrastructure.event.external.repository.domain.ExternalEventStatus.SENT, e.sentAt = :sentAt WHERE e.id IN :ids")
|
||||
void markEventsSent(List<Long> ids, OffsetDateTime sentAt);
|
||||
void markEventsSent(@Param("ids") List<Long> ids, @Param("sentAt") OffsetDateTime sentAt);
|
||||
}
|
||||
|
||||
+2
-1
@@ -22,11 +22,12 @@ import java.util.List;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
public interface LoanCollateralManagementRepository
|
||||
extends JpaRepository<LoanCollateralManagement, Long>, JpaSpecificationExecutor<LoanCollateralManagement> {
|
||||
|
||||
@Query("select loanCollaterals from LoanCollateralManagement loanCollaterals where loanCollaterals.loan=:loan")
|
||||
List<LoanCollateralManagement> findByLoan(Loan loan);
|
||||
List<LoanCollateralManagement> findByLoan(@Param("loan") Loan loan);
|
||||
|
||||
}
|
||||
|
||||
+6
-4
@@ -25,6 +25,7 @@ import org.apache.fineract.portfolio.loanaccount.data.LoanScheduleDelinquencyDat
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
public interface LoanRepaymentScheduleInstallmentRepository
|
||||
extends JpaRepository<LoanRepaymentScheduleInstallment, Long>, JpaSpecificationExecutor<LoanRepaymentScheduleInstallment> {
|
||||
@@ -42,8 +43,8 @@ public interface LoanRepaymentScheduleInstallmentRepository
|
||||
lrs.loan.loanProduct.delinquencyBucket IS NOT NULL
|
||||
GROUP BY lrs.loan
|
||||
""")
|
||||
Collection<LoanScheduleDelinquencyData> fetchLoanScheduleDataByDueDateAndObligationsMet(Integer loanStatus, LocalDate businessDate,
|
||||
boolean obligationsMet);
|
||||
Collection<LoanScheduleDelinquencyData> fetchLoanScheduleDataByDueDateAndObligationsMet(@Param("loanStatus") Integer loanStatus,
|
||||
@Param("businessDate") LocalDate businessDate, @Param("obligationsMet") boolean obligationsMet);
|
||||
|
||||
@Query("""
|
||||
SELECT new org.apache.fineract.portfolio.loanaccount.data.LoanScheduleDelinquencyData(
|
||||
@@ -59,7 +60,8 @@ public interface LoanRepaymentScheduleInstallmentRepository
|
||||
lrs.loan.id NOT IN :loanIds
|
||||
GROUP BY lrs.loan
|
||||
""")
|
||||
Collection<LoanScheduleDelinquencyData> fetchLoanScheduleDataByDueDateAndObligationsMet(Integer loanStatus, LocalDate businessDate,
|
||||
boolean obligationsMet, List<Long> loanIds);
|
||||
Collection<LoanScheduleDelinquencyData> fetchLoanScheduleDataByDueDateAndObligationsMet(@Param("loanStatus") Integer loanStatus,
|
||||
@Param("businessDate") LocalDate businessDate, @Param("obligationsMet") boolean obligationsMet,
|
||||
@Param("loanIds") List<Long> loanIds);
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -22,10 +22,11 @@ import java.util.Optional;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
public interface LoanRescheduleRequestRepository
|
||||
extends JpaRepository<LoanRescheduleRequest, Long>, JpaSpecificationExecutor<LoanRescheduleRequest> {
|
||||
|
||||
@Query("select lrr.loan.id from LoanRescheduleRequest lrr where lrr.id = :rescheduleRequestId")
|
||||
Optional<Long> getLoanIdByRescheduleRequestId(Long rescheduleRequestId);
|
||||
Optional<Long> getLoanIdByRescheduleRequestId(@Param("rescheduleRequestId") Long rescheduleRequestId);
|
||||
}
|
||||
|
||||
+2
-1
@@ -20,6 +20,7 @@ package org.apache.fineract.useradministration.domain;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
public interface PermissionRepository extends JpaRepository<Permission, Long> {
|
||||
|
||||
@@ -28,5 +29,5 @@ public interface PermissionRepository extends JpaRepository<Permission, Long> {
|
||||
// Also, trimming leading and trailing spaces is critical ("CREATE_STANDINGINSTRUCTION" vs
|
||||
// "CREATE_STANDINGINSTRUCTION ").
|
||||
@Query("SELECT p FROM Permission p WHERE LOWER(TRIM(BOTH FROM p.code)) = LOWER(TRIM(BOTH FROM ?1))")
|
||||
Permission findOneByCode(String code);
|
||||
Permission findOneByCode(@Param("code") String code);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user