R - The type of the result.@FunctionalInterface public interface BasicColumnMapper<R> extends ColumnMapper<R>
ColumnMapper retrieves a value from a ResultSet, and offers a way
to compose a chain of functions that maps the value. As the value retrieved
from the ResultSet is unconditionally passed down the chain of mapping functions, if
retrieving a value from a nullable column, consider using a NullableColumnMapper
instead.NullableColumnMapper| Modifier and Type | Method and Description |
|---|---|
default <S> BasicColumnMapper<S> |
andThen(Function<? super R,S> mapper)
Create a new
BasicColumnMapper which will map the result of this one
using the given function. |
default BasicColumnMapper<R> |
nullFallthrough()
Specify that a retrieved
null value will short circuit any
chain from this point. |
static <R> BasicColumnMapper<R> |
of(ThrowingBiFunction<String,ResultSet,R,? extends SQLException> function) |
forAttribute, mapstatic <R> BasicColumnMapper<R> of(ThrowingBiFunction<String,ResultSet,R,? extends SQLException> function)
default <S> BasicColumnMapper<S> andThen(Function<? super R,S> mapper)
BasicColumnMapper which will map the result of this one
using the given function.S - The type of object the new ColumnMapper yields from a ResultSetmapper - the mapping functionnullFallthrough()default BasicColumnMapper<R> nullFallthrough()
null value will short circuit any
chain from this point. A mapping chain can be constructed with
andThen(Function), and if a value retrieved from a ResultSet
is nullable, usually this should pass unchanged through a chain of mappers
as null. This eliminates the need for the mapping functions to handle
nulls.
This should be used for rare circumstances where the result from a function passed to
andThen(Function) can be null. If mapping a nullable database
column, consider using a NullableColumnMapper instead.
ColumnMapperNullableColumnMapperCopyright © 2016 Digipost. All rights reserved.