mirror of
https://github.com/spring-projects/spring-data-relational.git
synced 2026-05-04 05:18:20 +01:00
Use first column in case of duplicate columns.
Also, fallback on column names when label is not present. See #1680 Original pull request #1825
This commit is contained in:
+2
-2
@@ -73,8 +73,8 @@ class RowDocumentResultSetExtractor {
|
||||
for (int i = 0; i < columnCount; i++) {
|
||||
|
||||
Object rsv = JdbcUtils.getResultSetValue(resultSet, i + 1);
|
||||
String columnName = md.getColumnLabel(i + 1);
|
||||
Object old = document.put(columnName, rsv instanceof Array a ? a.getArray() : rsv);
|
||||
String columnName = JdbcUtils.lookupColumnName(md, i+1);
|
||||
Object old = document.putIfAbsent(columnName, rsv instanceof Array a ? a.getArray() : rsv);
|
||||
if (old != null) {
|
||||
log.warn(DUPLICATE_COLUMN_WARNING, columnName, i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user