use of org.jdbi.v3.core.mapper.reflect.internal.PojoProperties in project jdbi by jdbi.
the class PojoWarmingCustomizer method of.
public static SqlStatementParameterCustomizer of(Type pojoType, SqlStatementParameterCustomizer customizer) {
return new SqlStatementParameterCustomizer() {
@Override
public void apply(SqlStatement<?> stmt, Object arg) throws SQLException {
customizer.apply(stmt, arg);
}
@Override
public void warm(ConfigRegistry config) {
Arguments arguments = config.get(Arguments.class);
config.get(PojoTypes.class).findFor(pojoType).map(Stream::of).orElseGet(Stream::empty).map(PojoProperties::getProperties).map(Map::values).flatMap(Collection::stream).map(PojoProperty::getQualifiedType).forEach(arguments::prepareFor);
}
};
}
Aggregations