Package org.jdbi.v3.vavr
Class VavrTupleRowMapperFactory
- java.lang.Object
-
- org.jdbi.v3.vavr.VavrTupleRowMapperFactory
-
- All Implemented Interfaces:
RowMapperFactory
class VavrTupleRowMapperFactory extends java.lang.Object implements RowMapperFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static interfaceVavrTupleRowMapperFactory.MapperValueResolver
-
Constructor Summary
Constructors Constructor Description VavrTupleRowMapperFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<RowMapper<?>>build(java.lang.reflect.Type type, ConfigRegistry config)Supplies a row mapper which will map result set rows to type if the factory supports it; empty otherwise.private java.util.Optional<RowMapper<?>>buildMapper(java.lang.Class<? extends io.vavr.Tuple> tupleClass, io.vavr.collection.Array<java.util.Optional<RowMapper<?>>> colMappers)private io.vavr.TuplebuildTuple(java.lang.Class<? extends io.vavr.Tuple> tupleClass, VavrTupleRowMapperFactory.MapperValueResolver r)(package private) java.util.Optional<RowMapper<?>>getColumnMapper(java.lang.reflect.Type type, int tupleIndex, ConfigRegistry config)private java.util.Optional<RowMapper<?>>getColumnMapperForDefinedColumn(java.lang.reflect.Type type, java.lang.String col, ConfigRegistry config)(package private) io.vavr.control.Option<java.lang.String>getConfiguredColumnName(int tupleIndex, ConfigRegistry config)private java.util.Optional<RowMapper<?>>getRowMapper(java.lang.reflect.Type type, ConfigRegistry config)(package private) io.vavr.collection.Array<io.vavr.Tuple3<java.lang.reflect.Type,java.lang.Integer,io.vavr.control.Option<java.lang.String>>>resolveKeyValueColumns(ConfigRegistry config, io.vavr.collection.Array<io.vavr.Tuple2<java.lang.reflect.Type,java.lang.Integer>> tupleTypes)
-
-
-
Method Detail
-
build
public java.util.Optional<RowMapper<?>> build(java.lang.reflect.Type type, ConfigRegistry config)
Description copied from interface:RowMapperFactorySupplies a row mapper which will map result set rows to type if the factory supports it; empty otherwise.- Specified by:
buildin interfaceRowMapperFactory- Parameters:
type- the target type to map toconfig- the config registry, for composition- Returns:
- a row mapper for the given type if this factory supports it;
Optional.empty()otherwise. - See Also:
for composition
-
resolveKeyValueColumns
io.vavr.collection.Array<io.vavr.Tuple3<java.lang.reflect.Type,java.lang.Integer,io.vavr.control.Option<java.lang.String>>> resolveKeyValueColumns(ConfigRegistry config, io.vavr.collection.Array<io.vavr.Tuple2<java.lang.reflect.Type,java.lang.Integer>> tupleTypes)
-
buildMapper
private java.util.Optional<RowMapper<?>> buildMapper(java.lang.Class<? extends io.vavr.Tuple> tupleClass, io.vavr.collection.Array<java.util.Optional<RowMapper<?>>> colMappers)
-
buildTuple
private io.vavr.Tuple buildTuple(java.lang.Class<? extends io.vavr.Tuple> tupleClass, VavrTupleRowMapperFactory.MapperValueResolver r) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getColumnMapper
java.util.Optional<RowMapper<?>> getColumnMapper(java.lang.reflect.Type type, int tupleIndex, ConfigRegistry config)
-
getRowMapper
private java.util.Optional<RowMapper<?>> getRowMapper(java.lang.reflect.Type type, ConfigRegistry config)
-
getColumnMapperForDefinedColumn
private java.util.Optional<RowMapper<?>> getColumnMapperForDefinedColumn(java.lang.reflect.Type type, java.lang.String col, ConfigRegistry config)
-
getConfiguredColumnName
io.vavr.control.Option<java.lang.String> getConfiguredColumnName(int tupleIndex, ConfigRegistry config)
-
-