Repository navigation
FINERACT-3078: Replace native SQL in retrieveCurrency with QueryDSL query - #6932
Open
ImalkaPerera wants to merge 1 commit into
Open
ImalkaPerera wants to merge 1 commit into
ImalkaPerera wants to merge 1 commit into
Conversation
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
JIRA: https://issues.apache.org/jira/browse/FINERACT-3078
Replaces the native SQL in
CurrencyReadPlatformServiceImpl.retrieveCurrency(String)with a type-safe QueryDSL query. Behaviour is unchanged: same columns, samewhere code = ?andorder by name, and an unknown code still throwsEmptyResultDataAccessException.Changes
CurrencyReadPlatformServiceImpl:retrieveCurrencynow usesSQLQueryFactorywith the generatedQMCurrencytype.CurrencyDataProjection(new):MappingProjectionthat maps the selected columns toCurrencyData, following the pattern ofFinancialActivityAccountProjection.fineract-core/dependencies.gradle:fineract-corenow depends onfineract-querydslso the generated Q-types are available there.OrganisationMonetaryConfiguration: passesSQLQueryFactoryto the service constructor.CurrencyRowMapperandJdbcTemplatestay in the class until FINERACT-3076 and FINERACT-3077 convert the two remaining queries (retrieveAllowedCurrencies,retrieveAllPlatformCurrencies).Testing
CurrencyReadPlatformServiceImplTestruns the query through a realSQLQueryFactoryon a mocked JDBC connection (PostgreSQL and MySQL templates). It asserts the generated SQL, the bound parameter, the result mapping, nullable columns and the not-found exception.fineract-coretests pass (591), andfineract-providercompiles with the constructor change.Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!