use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project spring-data-jdbc by spring-projects.
the class JdbcRepositoryQuery method bindParameters.
private MapSqlParameterSource bindParameters(Object[] objects) {
MapSqlParameterSource parameters = new MapSqlParameterSource();
queryMethod.getParameters().getBindableParameters().forEach(p -> {
String parameterName = p.getName().orElseThrow(() -> new IllegalStateException(PARAMETER_NEEDS_TO_BE_NAMED));
parameters.addValue(parameterName, objects[p.getIndex()]);
});
return parameters;
}
Aggregations