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
ConstructorsConstructorDescriptionCreates aResultSetMapperwith default configuration.DefaultResultSetMapper(DatabaseType databaseType) Creates aResultSetMapperfor the givendatabaseType.DefaultResultSetMapper(DatabaseType databaseType, ZoneId timeZone) Creates aResultSetMapperfor the givendatabaseTypeandtimeZone.DefaultResultSetMapper(ZoneId timeZone) Creates aResultSetMapperfor 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 ofresultSetto the result class indicated bystatementContext.
-
Constructor Details
-
DefaultResultSetMapper
public DefaultResultSetMapper()Creates aResultSetMapperwith default configuration. -
DefaultResultSetMapper
Creates aResultSetMapperfor the givendatabaseType.- Parameters:
databaseType- the type of database we're working with
-
DefaultResultSetMapper
Creates aResultSetMapperfor the giventimeZone.- Parameters:
timeZone- the timezone to use when working withTimestampand similar values
-
DefaultResultSetMapper
Creates aResultSetMapperfor the givendatabaseTypeandtimeZone.- Parameters:
databaseType- the type of database we're working withtimeZone- the timezone to use when working withTimestampand 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:ResultSetMapperMaps the current row ofresultSetto the result class indicated bystatementContext.- Specified by:
mapin 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 theResultSetrow should be marshaledinstanceProvider- instance-creation factory, used to instantiateresultSetRowTyperow objects- Returns:
- an instance of the given
resultClass
-