Repository navigation
Conversation
Replace the native SQL of AccountNumberFormatReadPlatformServiceImpl #getAccountNumberFormat (native SQL inventory entry 075) with a type safe QueryDSL query on the generated QCAccountNumberFormat. The proposed translation on the ticket imports the Q-type from org.apache.fineract.querydsl and aliases the selected columns; neither is needed: the generated Q-type lives in org.apache.fineract.query and rows are read by path, as in the other converted read services. The row to AccountNumberFormatData mapping is shared with the JDBC RowMapper still used by getAllAccountNumberFormats (a separate inventory entry), so both paths map rows the same way. A missing row still raises AccountNumberFormatNotFoundException, now thrown directly on a null fetchOne() result instead of via the caught EmptyResultDataAccessException. The service is now @transactional(readOnly = true): the SQLQueryFactory bean uses a SpringConnectionProvider, which refuses connections outside a transaction.
QueryDSL rejects eq(null) with IllegalArgumentException before the query runs, while the previous JdbcTemplate lookup bound SQL NULL, matched no rows and raised AccountNumberFormatNotFoundException. Throw AccountNumberFormatNotFoundException up front for a null id so the service contract is unchanged.
PCTEJA
force-pushed
the
FINERACT-3267-account-number-format-querydsl
branch
from
December 5, 2026 21:12
7bd5776 to
53ae60c
Compare
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
FINERACT-3267: native SQL inventory entry 075.
AccountNumberFormatReadPlatformServiceImpl#getAccountNumberFormatnow uses a type safe QueryDSL query on the generatedQCAccountNumberFormatinstead of the native SQL string.org.apache.fineract.querydsland aliases the selected columns. Neither is needed: the generated Q-type lives inorg.apache.fineract.queryand rows are read by path, as in the other converted read services.AccountNumberFormatDatamapping moved into a sharedtoData(...)method. The JDBCRowMapperstill used bygetAllAccountNumberFormats(a separate inventory entry) calls it too, so both paths map rows the same way.AccountNumberFormatNotFoundException, now thrown directly on a nullfetchOne()result (and up front for a null id) instead of via the caughtEmptyResultDataAccessException.@Transactional(readOnly = true)(Spring's). TheSQLQueryFactorybean uses aSpringConnectionProvider, which refuses connections outside a transaction, so without it the lookup would fail.AccountNumberPreferencesTestintegration test covers the endpoint on all 3 databases.Checklist
AccountNumberPreferencesTestcovers this endpoint.)