Package org.jdbi.v3.core.mapper
Class InferredRowMapperFactory
java.lang.Object
org.jdbi.v3.core.mapper.InferredRowMapperFactory
- All Implemented Interfaces:
RowMapperFactory
A generic RowMapperFactory that reflectively inspects a
RowMapper<T> and maps only to columns of type
T. The type parameter T must be accessible
via reflection or an UnsupportedOperationException
will be thrown.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild(Type type, ConfigRegistry config) Supplies a row mapper which will map result set rows to type if the factory supports it; empty otherwise.detectType(RowMapper<?> mapper)
-
Field Details
-
maps
-
mapper
-
-
Constructor Details
-
InferredRowMapperFactory
InferredRowMapperFactory(RowMapper<?> mapper)
-
-
Method Details
-
detectType
-
build
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:
-