public interface DbMapperManager
Mapper manager of all configured
mappers
.-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final GenericType<DbRow>
Generic type for theDbRow
class.static final GenericType<List<?>>
Generic type for theList
of indexed parameters.static final GenericType<Map<String,
?>> Generic type for theMap
of String to value pairs for named parameters. -
Method Summary
Modifier and TypeMethodDescriptionstatic DbMapperManager.Builder
builder()
Create a fluent API builder to configure the mapper manager.static DbMapperManager
create()
Create a new mapper manager from Java Service loader only.static DbMapperManager
create
(HelidonServiceLoader<DbMapperProvider> serviceLoader) Create a new mapper manager from customizedHelidonServiceLoader
.<T> T
read
(DbRow row, GenericType<T> expectedType) Read database row into a typed value.<T> T
Read database row into a typed value.<T> List<?>
toIndexedParameters
(T value, Class<T> valueClass) Read object into a list of indexed parameters.toNamedParameters
(T value, Class<T> valueClass) Read object into a map of named parameters.
-
Field Details
-
Method Details
-
builder
Create a fluent API builder to configure the mapper manager.- Returns:
- a new builder instance
-
create
Create a new mapper manager from Java Service loader only.- Returns:
- mapper manager
-
create
Create a new mapper manager from customizedHelidonServiceLoader
.- Parameters:
serviceLoader
- service loader to use to read allDbMapperProvider
- Returns:
- mapper manager
-
read
Read database row into a typed value.- Type Parameters:
T
- type of the response- Parameters:
row
- row from a databaseexpectedType
- class of the response- Returns:
- instance with data from the row
- Throws:
MapperException
- in case the mapper was not found- See Also:
-
read
Read database row into a typed value.- Type Parameters:
T
- type of the response- Parameters:
row
- row from a databaseexpectedType
- generic type of the response- Returns:
- instance with data from the row
- Throws:
MapperException
- in case the mapper was not found- See Also:
-
toNamedParameters
Read object into a map of named parameters.- Type Parameters:
T
- type of value- Parameters:
value
- the typed valuevalueClass
- type of the value object- Returns:
- map with the named parameters
- See Also:
-
toIndexedParameters
Read object into a list of indexed parameters.- Type Parameters:
T
- type of value- Parameters:
value
- the typed valuevalueClass
- type of the value object- Returns:
- list with indexed parameters (in the order expected by statements using this object)
- See Also:
-