Class ColumnMapRowMapper
java.lang.Object
org.springframework.r2dbc.core.ColumnMapRowMapper
- All Implemented Interfaces:
- BiFunction<Row, RowMetadata, Map<String,- Object>> 
public class ColumnMapRowMapper
extends Object
implements BiFunction<Row, RowMetadata, Map<String,Object>> 
Mapping function implementation that creates a
java.util.Map for each row, representing all columns as
key-value pairs: one entry for each column, with the column name as key.
The Map implementation to use and the key to use for each column
in the column Map can be customized through overriding
createColumnMap(int) and getColumnKey(String), respectively.
Note: By default, ColumnMapRowMapper will try to build a linked Map with case-insensitive keys, to preserve column order as well as allow any casing to be used for column names. This requires Commons Collections on the classpath (which will be autodetected). Else, the fallback is a standard linked HashMap, which will still preserve column order but requires the application to specify the column names in the same casing as exposed by the driver.
- Since:
- 5.3
- Author:
- Mark Paluch
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final ColumnMapRowMapperA defaultColumnMapRowMapperinstance.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionapply(Row row, RowMetadata rowMetadata) createColumnMap(int columnCount) Create aMapinstance to be used as column map.protected StringgetColumnKey(String columnName) Determine the key to use for the given column in the columnMap.getColumnValue(Row row, int index) Retrieve a R2DBC object value for the specified column.Methods inherited from class Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiFunctionandThen
- 
Field Details- 
INSTANCEA defaultColumnMapRowMapperinstance.
 
- 
- 
Constructor Details- 
ColumnMapRowMapperpublic ColumnMapRowMapper()
 
- 
- 
Method Details- 
apply- Specified by:
- applyin interface- BiFunction<Row, RowMetadata, Map<String,- Object>> 
 
- 
createColumnMap
- 
getColumnKey
- 
getColumnValueRetrieve a R2DBC object value for the specified column.The default implementation uses the Readable.get(int)method.- Parameters:
- row- is the- Rowholding the data
- index- is the column index
- Returns:
- the Object returned
 
 
-