-
Notifications
You must be signed in to change notification settings - Fork 373
Description
Pavel Kapyla opened DATAJDBC-407 and commented
If one have an entity with case-sensitive columns (e.g. on Postgres database) DML statements generated by default implementation of CrudRepository product wrong statements.
@AllArgsConstructor
static class EntityWithCaseSensitiveColumnName {
@Id @Column("\"primaryKey\"") Long id;
@Column("\"ValueCol\"") String name;
@Column("\"test_@123\"") String name2;
}
INSERT INTO entity_with_case_sensitive_column_name ("ValueCol", "test_@123", "primaryKey") VALUES (:ValueCol, :test_123, :primaryKey)
But binding parameters leads to exception:
No value supplied for the SQL parameter 'ValueCol': No value registered for key 'ValueCol'
because the parameterSource uses column names (with excaping commas) as keys for parameter values.
The same problem was partly addressed in DATAJDBC-334, now columns are correctly escaped, bad parameters problem still exists.
Actually the fix (DATAJDBC-381) solves the issue but padding with "_" is not needed in this case.
I hope it's possible to fix the problem in RC3
Affects: 1.0.10 (Lovelace SR10), 1.1 RC2 (Moore)
Issue Links:
-
DATAJDBC-381 Using backticks in column names leads to failure during INSERT with MySQL
-
DATAJDBC-386 Always quote identifiers