Package org.jdbi.v3.vavr
Class TupleMappers
java.lang.Object
org.jdbi.v3.vavr.TupleMappers
- All Implemented Interfaces:
JdbiConfig<TupleMappers>
,MapEntryConfig<TupleMappers>
public class TupleMappers
extends Object
implements JdbiConfig<TupleMappers>, MapEntryConfig<TupleMappers>
Mappers similar to
MapEntryMappers
but map entries in vavr are in fact
of type Tuple2
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of this configuration object.getColumn
(int tupleIndex) Returns the name for a column.Names a specific column in the mapper.setKeyColumn
(String keyColumn) Sets the column that map entry keys are loaded from.void
setRegistry
(ConfigRegistry registry) The registry will inject itself into the configuration object.setValueColumn
(String valueColumn) Sets the column that map entry values are loaded from.
-
Constructor Details
-
TupleMappers
public TupleMappers()
-
-
Method Details
-
getKeyColumn
- Specified by:
getKeyColumn
in interfaceMapEntryConfig<TupleMappers>
-
setKeyColumn
Description copied from interface:MapEntryConfig
Sets the column that map entry keys are loaded from. If set, keys will be loaded from the given column, using theColumnMapper
registered for the key type. If unset, keys will be loaded using theRowMapper
registered for the key type, from whichever columns that row mapper uses.- Specified by:
setKeyColumn
in interfaceMapEntryConfig<TupleMappers>
- Parameters:
keyColumn
- the key column name. not null- Returns:
- this config object, for call chaining
-
getValueColumn
- Specified by:
getValueColumn
in interfaceMapEntryConfig<TupleMappers>
-
setValueColumn
Description copied from interface:MapEntryConfig
Sets the column that map entry values are loaded from. If set, values will be loaded from the given column, using theColumnMapper
registered for the value type. If unset, values will be loaded using theRowMapper
registered for the value type, from whichever columns that row mapper uses.- Specified by:
setValueColumn
in interfaceMapEntryConfig<TupleMappers>
- Parameters:
valueColumn
- the value column name. not null- Returns:
- this config object, for call chaining
-
setColumn
Names a specific column in the mapper.- Parameters:
tupleIndex
- the 1 based index of the TupleX. as in _1, _2 etc.name
- the column name to be mapped explicitly- Returns:
- Config object for chaining
-
getColumn
Returns the name for a column.- Parameters:
tupleIndex
- the 1 based index of the TupleX. as in _1, _2 etc.- Returns:
- the column name to be mapped explicitly
-
createCopy
Description copied from interface:JdbiConfig
Returns a copy of this configuration object. Changes to the copy should not modify the original, and vice-versa.- Specified by:
createCopy
in interfaceJdbiConfig<TupleMappers>
- Returns:
- a copy of this configuration object.
-
setRegistry
Description copied from interface:JdbiConfig
The registry will inject itself into the configuration object. This can be useful if you need to look up dependencies. You will get a new registry after being copied.- Specified by:
setRegistry
in interfaceJdbiConfig<TupleMappers>
- Parameters:
registry
- the registry that owns this configuration object
-