EnumarableMapper<ROW,SET,T>, FieldMapper<ROW,SET>, Mapper<ROW,SET>, SetRowMapper<ROW,SET,T,E>public class DynamicSetRowMapper<ROW,SET,T,E extends Exception,K extends FieldKey<K>> extends Object implements SetRowMapper<ROW,SET,T,E>
| Constructor | Description |
|---|---|
DynamicSetRowMapper(org.simpleflatmapper.util.UnaryFactory<MapperKey<K>,SetRowMapper<ROW,SET,T,E>> mapperFactory,
org.simpleflatmapper.util.UnaryFactoryWithException<ROW,MapperKey<K>,E> mapperKeyFromRow,
org.simpleflatmapper.util.UnaryFactoryWithException<SET,MapperKey<K>,E> mapperKeyFromSet,
MapperKeyComparator<K> keyComparator) |
| Modifier and Type | Method | Description |
|---|---|---|
<H extends org.simpleflatmapper.util.CheckedConsumer<? super T>> |
forEach(SET set,
H handler) |
Loop over the resultSet, map each row to a new newInstance of T and call back the handler
|
SetRowMapper<ROW,SET,T,E> |
getMapper(MapperKey<K> key) |
|
Iterator<T> |
iterator(SET rs) |
|
T |
map(ROW row) |
map source object to a new newInstance of T
|
T |
map(ROW row,
MappingContext<? super ROW> context) |
|
void |
mapTo(ROW row,
T target,
MappingContext<? super ROW> context) |
map source object to target object.
|
Stream<T> |
stream(SET set) |
|
String |
toString() |
public DynamicSetRowMapper(org.simpleflatmapper.util.UnaryFactory<MapperKey<K>,SetRowMapper<ROW,SET,T,E>> mapperFactory, org.simpleflatmapper.util.UnaryFactoryWithException<ROW,MapperKey<K>,E> mapperKeyFromRow, org.simpleflatmapper.util.UnaryFactoryWithException<SET,MapperKey<K>,E> mapperKeyFromSet, MapperKeyComparator<K> keyComparator)
public final T map(ROW row) throws MappingException
Mappermap in interface Mapper<ROW,SET>row - object to map fromMappingException - if an exception occurspublic final T map(ROW row, MappingContext<? super ROW> context) throws MappingException
map in interface Mapper<ROW,SET>MappingExceptionpublic final void mapTo(ROW row, T target, MappingContext<? super ROW> context) throws Exception
FieldMappermapTo in interface FieldMapper<ROW,SET>row - object to map fromtarget - object to map tocontext - the mapping contextException - if an exception occurspublic final Iterator<T> iterator(SET rs) throws E extends Exception, MappingException
iterator in interface EnumarableMapper<ROW,SET,T>rs - the sourceE - if source error occursMappingException - if an error occurs during the mappingE extends Exceptionpublic final Stream<T> stream(SET set) throws E extends Exception, MappingException
stream in interface EnumarableMapper<ROW,SET,T>set - the sourceE - if source error occursMappingException - if an error occurs during the mappingE extends Exceptionpublic final <H extends org.simpleflatmapper.util.CheckedConsumer<? super T>> H forEach(SET set, H handler) throws E extends Exception, MappingException
EnumarableMapper
The method will return the handler passed as an argument so you can easily chain the calls like
List<T> list = jdbcMapper.forEach(rs, new ListHandler<T>()).getList();
forEach in interface EnumarableMapper<ROW,SET,T>H - the row handler typeset - the sourcehandler - the handler that will get the callbackE - if source error occursMappingException - if an error occurs during the mappingE extends ExceptionCopyright © 2018. All rights reserved.