public final class JdbcMapperImpl<T> extends MapperImpl<ResultSet,T> implements JdbcMapper<T>
| Constructor and Description |
|---|
JdbcMapperImpl(FieldMapper<ResultSet,T>[] fieldMappers,
FieldMapper<ResultSet,T>[] constructorMappers,
Instantiator<ResultSet,T> instantiator,
RowHandlerErrorHandler errorHandler,
MappingContextFactory<ResultSet> mappingContextFactory) |
| Modifier and Type | Method and Description |
|---|---|
<H extends RowHandler<? super T>> |
forEach(ResultSet rs,
H handler)
Loop over the resultSet, map each row to a new instance of T and call back the handler
|
Iterator<T> |
iterate(ResultSet rs)
Deprecated.
|
Iterator<T> |
iterator(ResultSet rs) |
Stream<T> |
stream(ResultSet rs) |
mapFields, mapToFields, toStringappendToStringBuilder, map, map, mapTo, newMappingContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitmap, map, newMappingContextmapTopublic JdbcMapperImpl(FieldMapper<ResultSet,T>[] fieldMappers, FieldMapper<ResultSet,T>[] constructorMappers, Instantiator<ResultSet,T> instantiator, RowHandlerErrorHandler errorHandler, MappingContextFactory<ResultSet> mappingContextFactory)
public final <H extends RowHandler<? super T>> H forEach(ResultSet rs, H handler) throws SQLException, MappingException
JdbcMapper
The method will return the handler passed as an argument so you can easily chain the calls like
List<T> list = mapper.forEach(rs, new ListHandler<T>()).getList();
forEach in interface JdbcMapper<T>H - the row handler typers - the resultSethandler - the handler that will get the callbackSQLException - if sql error occursMappingException - if an error occurs during the mapping@Deprecated public Iterator<T> iterate(ResultSet rs) throws SQLException, MappingException
iterate in interface JdbcMapper<T>SQLExceptionMappingExceptionpublic Iterator<T> iterator(ResultSet rs) throws SQLException, MappingException
iterator in interface JdbcMapper<T>rs - the result setSQLException - if sql error occursMappingException - if an error occurs during the mappingpublic Stream<T> stream(ResultSet rs) throws SQLException, MappingException
stream in interface JdbcMapper<T>rs - the result setSQLException - if sql error occursMappingException - if an error occurs during the mappingCopyright © 2015. All rights reserved.