Package com.pyranid
Class DefaultResultSetMapper
java.lang.Object
com.pyranid.DefaultResultSetMapper
- All Implemented Interfaces:
ResultSetMapper
Basic implementation of
ResultSetMapper
.- Since:
- 1.0.0
- Author:
- Mark Allen
-
Constructor Summary
ConstructorDescriptionCreates aResultSetMapper
with default configuration.DefaultResultSetMapper
(DatabaseType databaseType) Creates aResultSetMapper
for the givendatabaseType
.DefaultResultSetMapper
(DatabaseType databaseType, ZoneId timeZone) Creates aResultSetMapper
for the givendatabaseType
andtimeZone
.DefaultResultSetMapper
(ZoneId timeZone) Creates aResultSetMapper
for the giventimeZone
. -
Method Summary
Modifier and TypeMethodDescription<T> Optional
<T> map
(StatementContext<T> statementContext, ResultSet resultSet, Class<T> resultSetRowType, InstanceProvider instanceProvider) Maps the current row ofresultSet
to the result class indicated bystatementContext
.
-
Constructor Details
-
DefaultResultSetMapper
public DefaultResultSetMapper()Creates aResultSetMapper
with default configuration. -
DefaultResultSetMapper
Creates aResultSetMapper
for the givendatabaseType
.- Parameters:
databaseType
- the type of database we're working with
-
DefaultResultSetMapper
Creates aResultSetMapper
for the giventimeZone
.- Parameters:
timeZone
- the timezone to use when working withTimestamp
and similar values
-
DefaultResultSetMapper
Creates aResultSetMapper
for the givendatabaseType
andtimeZone
.- Parameters:
databaseType
- the type of database we're working withtimeZone
- the timezone to use when working withTimestamp
and similar values- Since:
- 1.0.15
-
-
Method Details
-
map
@Nonnull public <T> Optional<T> map(@Nonnull StatementContext<T> statementContext, @Nonnull ResultSet resultSet, @Nonnull Class<T> resultSetRowType, @Nonnull InstanceProvider instanceProvider) Description copied from interface:ResultSetMapper
Maps the current row ofresultSet
to the result class indicated bystatementContext
.- Specified by:
map
in interfaceResultSetMapper
- Type Parameters:
T
- result instance type token- Parameters:
statementContext
- current SQL contextresultSet
- provides raw row data to pull from*resultSetRowType
- the type to which theResultSet
row should be marshaledinstanceProvider
- instance-creation factory, used to instantiateresultSetRowType
row objects- Returns:
- an instance of the given
resultClass
-