Can the DefaultRecordMapper work case insensitive?
The reason for the question is that Oracle and H2 have the default behavior
of captilazing identifiers if not quoted (see https://seeq.atlassian.net/wiki/spaces/KB/pages/443088907/SQL+Column+Names+and+Case+Sensitivity and https://community.oracle.com/tech/developers/discussion/895094/is-there-anyway-to-make-oracle-field-names-case-insensitive-or-is-it-just). Unlike SQL Server which uses the case sensitivity as the table was created.
The case sensitivity of the SQL output then does not match with the field of the POJO for Oracle and H2.
The only 2 solutions I could think of are:
- Aliasing every column with quotes via an own helper method to ensure the correct case sensitivity (
ITEMUNIT as "itemUnit"). - Implement an own record mapper which works case-insensitive.
The first solution however has a disadvantage. In case fetch is used instead of fetchInto to work raw
with the result, the get method for a column value would need the alias too. So, the developer needs to know that there
is a distinction between using the helper method only for fetchInto and the normal select for fetch.
Have I missed something? Is there a better/easier solution to this?
I have found https://www.jooq.org/doc/latest/manual/sql-building/dsl-context/custom-settings/settings-name-style/ but this does not solve the problem.