Skip to content

Use toSqlParameterSource in StatementSpec.paramSource(Object) - #37501

Merged
sbrannen merged 1 commit into
spring-projects:mainfrom
guanchengang:fix/jdbcclient-paramsource-object
Oct 19, 2026
Merged

sbrannen merged 1 commit into
spring-projects:mainfrom
guanchengang:fix/jdbcclient-paramsource-object

Conversation

@guanchengang

Copy link
Copy Markdown
Contributor

I think this may be an oversight.

DefaultJdbcClient's `StatementSpec.paramSource(Object)` hand-rolled
the `SqlParameterSource` conversion instead of reusing the existing
toSqlParameterSource helper, so a `SqlParameterSource` passed through
the `Object-typed` overload was wrapped in a
`SimplePropertySqlParameterSource` and its values were never resolved.

Align the Object overload with `DefaultBatchEntry.paramSource(Object)`,
which already delegates to `toSqlParameterSource`.

Signed-off-by: Chengang Guan <guanchengang@qq.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 16, 2026
@guanchengang

Copy link
Copy Markdown
Contributor Author

MultipartWebClientIntegrationTests > transferTo(HttpServer) > [2] Jetty Core FAILED
java.lang.AssertionError at MessageFormatter.java:115

I think this might be a flaky test.

@sbrannen sbrannen self-assigned this Oct 16, 2026
@sbrannen sbrannen added in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 16, 2026
@sbrannen sbrannen modified the milestones: 7.1.x, 7.1.0-RC2 Oct 17, 2026
@sbrannen
sbrannen merged commit 776508c into spring-projects:main Oct 19, 2026
4 of 5 checks passed
sbrannen added a commit that referenced this pull request Oct 19, 2026
@sbrannen

Copy link
Copy Markdown
Member

This has been merged into main in 776508c and slightly revised in 78276e4.

Thanks

sbrannen pushed a commit that referenced this pull request Oct 20, 2026
SqlParameterSourceUtils.createBatch wraps every candidate that is not
a Map in a BeanPropertySqlParameterSource, so an SqlParameterSource
passed in is exposed through its own bean properties instead of its
parameter values.

This commit returns such a candidate as-is, as JdbcClient now does
for paramSource(Object) and its batch entries.

See gh-37501
Closes gh-37524

Signed-off-by: lejuho <zedd1324@gmail.com>
@guanchengang
guanchengang deleted the fix/jdbcclient-paramsource-object branch October 22, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants