mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-03 13:39:34 +00:00
When a column was declared via usingColumns() and also listed in usingGeneratedKeyColumns(), TableMetaDataContext.reconcileColumnsToUse accepted the declared list as-is: the generated key column was rendered into the INSERT statement and counted against the parameter values, even though the database is expected to generate its value. Such an overlap is a configuration error, so it is now rejected at compile time with an InvalidDataAccessApiUsageException naming the offending columns in their declared spelling, consistent with the existing validation in AbstractJdbcInsert.compile(). Matching is case-insensitive, mirroring the normalization used for auto-discovered columns; the auto-discovery path itself is unchanged and continues to exclude generated key columns silently. The tests cover the rejection, its message, a case-insensitive variant, and the untouched non-overlapping declared path. Closes gh-37014 Signed-off-by: junhyeong9812 <pickjog@gmail.com>