-
Notifications
You must be signed in to change notification settings - Fork 229
Description
Hello.
While migrating Java 11 -> 17 I updated sql2o package from 1.6.0 to 1.9.1.
The following code started to fall:
query .addColumnMapping("updated_at", "lastUpdatedAt") .setAutoDeriveColumnNames(true) .executeAndFetchFirst(MyObject.class)
By debugging the source code I can see that inside of PojoBuilder.withValue() function now the columnName is first changed to derivedName and only afterwards applied to provided columnMappings.
Along the code updated_at is transformed into updatedat and only then compared to the mapping provided.
To support both addColumnMapping for this specific parameter and setAutoDeriveColumnNames(true) for rest parameters, I had to workaround set column mapping as .addColumnMapping("updatedat", "lastUpdatedAt") which is pretty confusing and not straightforward.
I'd expect that deriving name convention would not be applied if I explicitly add custom column mapping.