Invert findColumn fallback to try common underscore naming first

Closes gh-37297
This commit is contained in:
Juergen Hoeller
2026-09-18 20:58:37 +02:00
parent cb9ce4d9e2
commit 2a15cd498a
@@ -130,12 +130,12 @@ public class SimplePropertyRowMapper<T> implements RowMapper<T> {
String name = this.constructorParameterNames[i];
int index;
try {
// Try direct name match first
index = rs.findColumn(name);
// Try common underscored name match first
index = rs.findColumn(JdbcUtils.convertPropertyNameToUnderscoreName(name));
}
catch (SQLException ex) {
// Try underscored name match instead
index = rs.findColumn(JdbcUtils.convertPropertyNameToUnderscoreName(name));
// Try direct name match (typically with camelCase) instead
index = rs.findColumn(name);
}
TypeDescriptor td = this.constructorParameterTypes[i];
Object value = JdbcUtils.getResultSetValue(rs, index, td.getType());