FINERACT-xxxx: Add equals() and hashCode() to LoanTransaction#5855
Open
Harshdhall01 wants to merge 1 commit into
Open
FINERACT-xxxx: Add equals() and hashCode() to LoanTransaction#5855Harshdhall01 wants to merge 1 commit into
Harshdhall01 wants to merge 1 commit into
Conversation
LoanTransaction was missing equals() and hashCode() implementations, noted by a TODO comment since the parent class AbstractPersistableCustom intentionally omits them. Added id-based implementations consistent with the pattern used in LoanDisbursementDetails, ensuring correct behavior if LoanTransaction is ever used in hash-based collections.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
LoanTransactionwas missingequals()andhashCode()implementations,flagged by a long-standing TODO comment in the code:
The parent class
AbstractPersistableCustomintentionally omits these methods(documented in its own Javadoc). Added id-based implementations consistent with
the pattern already used in
LoanDisbursementDetails, ensuring correct behaviorif
LoanTransactionis ever used in hash-based collections.Changes
equals()based on entity id with null-safety for unsaved entitieshashCode()based on entity idjava.util.ObjectsimportNote: JIRA ticket will be linked once Apache JIRA account approval is received.
I am exploring this codebase as part of my DMP 2026 (C4GT) application for the
"Dynamic Pricing of Micro-loans Using Reinforcement Learning" project under
openMF/Mifos. The loan module is directly relevant as it contains the core
transaction logic that my RL environment will model for dynamic pricing decisions.
Checklist