diff --git a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java index c87fe1bd0e6..b061f769579 100644 --- a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java +++ b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java @@ -135,7 +135,7 @@ public class LoanRepaymentScheduleInstallment extends AbstractAuditableWithUTCDa private Set loanCompoundingDetails = new HashSet<>(); @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER, mappedBy = "loanRepaymentScheduleInstallment") - private Set postDatedChecks; + private Set postDatedChecks = new HashSet<>(); @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY, mappedBy = "installment") private Set installmentCharges = new HashSet<>(); diff --git a/fineract-loan/src/main/java/org/apache/fineract/portfolio/repaymentwithpostdatedchecks/domain/PostDatedChecks.java b/fineract-loan/src/main/java/org/apache/fineract/portfolio/repaymentwithpostdatedchecks/domain/PostDatedChecks.java index 735fcd0b65d..5b3c768943c 100644 --- a/fineract-loan/src/main/java/org/apache/fineract/portfolio/repaymentwithpostdatedchecks/domain/PostDatedChecks.java +++ b/fineract-loan/src/main/java/org/apache/fineract/portfolio/repaymentwithpostdatedchecks/domain/PostDatedChecks.java @@ -22,7 +22,6 @@ import jakarta.persistence.Entity; import jakarta.persistence.JoinColumn; import jakarta.persistence.ManyToOne; -import jakarta.persistence.OneToOne; import jakarta.persistence.Table; import java.math.BigDecimal; import java.time.LocalDate; @@ -40,7 +39,7 @@ public class PostDatedChecks extends AbstractPersistableCustom { @ManyToOne(optional = false) @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false) private Loan loan; - @OneToOne(optional = false) + @ManyToOne(optional = false) @JoinColumn(name = "repayment_id", referencedColumnName = "id", nullable = false) private LoanRepaymentScheduleInstallment loanRepaymentScheduleInstallment; @Column(name = "account_no", nullable = false, length = 10)