@Override
    @SuppressWarnings("PMD.AvoidAccessibilityAlteration")
    public RowMapper<C> specialize(ResultSet rs, StatementContext ctx) throws SQLException {
        Constructor<C> constructor;
        try {
            constructor = clazz.getDeclaredConstructor();
        } catch (ReflectiveOperationException | SecurityException e) {
            throw new EntityMemberAccessException("Unable to get constructor for " + clazz, e);
        }
        constructor.setAccessible(true);

        List<MemberSetter<C>> setters = new ArrayList<>();

        for (int colIndex = rs.getMetaData().getColumnCount(); colIndex >= 1; colIndex--) {
            String columnLabel = rs.getMetaData().getColumnLabel(colIndex);
            JpaMember member = jpaClass.lookupMember(columnLabel);
            if (member != null) {
                QualifiedType<?> memberType = member.getQualifiedType();
                ColumnMapper<?> columnMapper = ctx.findColumnMapperFor(memberType)
                        .orElseThrow(() -> new NoSuchMapperException("No column mapper for " + memberType));

                final int columnIndex = colIndex;
                setters.add(obj -> member.write(obj, columnMapper.map(rs, columnIndex, ctx)));
            }
        }

        return (r, c) -> {
            C obj;
            try {
                obj = constructor.newInstance();
            } catch (ReflectiveOperationException | SecurityException e) {
                throw new EntityMemberAccessException("Unable to invoke " + constructor, e);
            }
            for (MemberSetter<C> setter : setters) {
                setter.mapAndSetMember(obj);
            }
            return obj;
        };
    }
Row mapper for a JPA-annotated type as a result.
@param <C> the type to map
jpa/src/main/java/org/jdbi/v3/jpa/JpaMapper.java