private Consumer<List<Long>> newGeneratedKeyConsumer(ENTITY entity) {
        return l -> {
            if (!l.isEmpty()) {
                final AtomicInteger cnt = new AtomicInteger();

                // Just assume that they are in order, what else is there to do?
                generatedFieldSupports.forEach(generated -> {

                    // Cast from Long to the column target type
                    final Object val = generated.mapping
                        .parse(l.get(cnt.getAndIncrement()));

                    @SuppressWarnings("unchecked")
                    final Object javaValue = ((TypeMapper<Object, Object>) 
                        generated.field.typeMapper()
                        ).toJavaType(generated.column, entityClass, val);

                    generated.field.setter().set(entity, javaValue);
                });
            }
        };
    }
Default implementation of the {@link SqlPersistence}-interface.

@param <ENTITY>  the entity type

@author  Emil Forslund
@author  Dan Lawesson
@since   3.0.1
runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/sql/SqlPersistenceProviderImpl.java