Search in sources :

Example 1 with JdbcMapper

use of org.simpleflatmapper.jdbc.JdbcMapper in project SimpleFlatMapper by arnaudroger.

the class JdbcMapperBuilderTest method getSubMapper.

private Mapper<ResultSet, DbObject> getSubMapper(JdbcMapper<DbObject> mapper) throws Exception {
    Field field;
    try {
        field = mapper.getClass().getDeclaredField("mapper");
    } catch (NoSuchFieldException e) {
        field = mapper.getClass().getSuperclass().getDeclaredField("mapper");
    }
    field.setAccessible(true);
    return new FieldGetter<JdbcMapper<?>, MapperImpl<ResultSet, DbObject>>(field).get(mapper);
}
Also used : Field(java.lang.reflect.Field) MapperImpl(org.simpleflatmapper.map.mapper.MapperImpl) JdbcMapper(org.simpleflatmapper.jdbc.JdbcMapper)

Aggregations

Field (java.lang.reflect.Field)1 JdbcMapper (org.simpleflatmapper.jdbc.JdbcMapper)1 MapperImpl (org.simpleflatmapper.map.mapper.MapperImpl)1