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 and getColumnKey, 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.
| Modifier and Type | Field and Description |
|---|---|
| public static final ColumnMapRowMapper | INSTANCE
A default |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Map | apply(Row
the first function argument row, RowMetadata the second function argument rowMetadata)Implements java. Applies this function to the given arguments. |
| protected Map | Returns: the newMap instancethe column count, to be used as initial capacity for the Map columnCount)Create a |
| protected String | Returns: the column key to usethe column name as returned by the columnName)RowDetermine the key to use for the given column in the column |
| protected Object | Returns: the Object returnedis the row, int Row holding the datais the column index index)Retrieve a R2DBC object value for the specified column. |
| INSTANCE | back to summary |
|---|---|
| public static final ColumnMapRowMapper INSTANCE A default | |
| ColumnMapRowMapper | back to summary |
|---|---|
| public ColumnMapRowMapper() | |
| apply | back to summary |
|---|---|
| public Map Implements java. Doc from java. Applies this function to the given arguments.
| |
| createColumnMap | back to summary |
|---|---|
| protected Map Create a By default, a linked case-insensitive Map will be created.
| |
| getColumnKey | back to summary |
|---|---|
| protected String getColumnKey(String columnName) Determine the key to use for the given column in the column
| |
| getColumnValue | back to summary |
|---|---|
| protected Object getColumnValue(Row row, int index) Retrieve a R2DBC object value for the specified column. The default implementation uses the | |