SQLErrorCodeSQLExceptionTranslator#hasUserProvidedErrorCodesFile
implementation does not currently allow to avoid SQLErrorCodesFactory
constructor to be reachable from a native image POV when there is no custom org/springframework/jdbc/support/sql-error-codes.xml
provided by the user.
With a small refactoring introducing a SQLErrorCodeSQLExceptionTranslator#USER_PROVIDED_ERROR_CODES_FILE_PRESENT
static field and making SQLErrorCodesFactory#instance
initialization lazy, it is possible to not include SQLErrorCodesFactory
constructor by default in native images, avoiding to ship XmlBeanDefinitionReader
and related transitive dependencies.