Skip to content

Improve JdbcClient to align BatchSpec with StatementSpec - #37307

Open
quaff wants to merge 1 commit into
spring-projects:mainfrom
quaff:patch-154
Open

quaff wants to merge 1 commit into
spring-projects:mainfrom
quaff:patch-154

Conversation

@quaff

@quaff quaff commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Add missing methods:

  1. param(int jdbcIndex, @Nullable Object value)
  2. param(int jdbcIndex, @Nullable Object value, int sqlType)
  3. param(String name, @Nullable Object value, int sqlType)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 20, 2026
@sbrannen sbrannen self-assigned this Sep 20, 2026
@sbrannen sbrannen added the in: data Issues in data modules (jdbc, orm, oxm, tx) label Sep 20, 2026
@sbrannen sbrannen added this to the 7.1.x milestone Sep 20, 2026
@sbrannen sbrannen added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 20, 2026

@sbrannen sbrannen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestions and the PR.

I've requested a small fix.

@sbrannen sbrannen added the status: waiting-for-feedback We need additional information before we can continue label Sep 21, 2026

@sbrannen sbrannen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new tests in JdbcClientIntegrationTests use add() more than once, resulting in a multi-statement batch update. However, the new unit tests in JdbcClientIndexedParameterTests and JdbcClientNamedParameterTests only have a single add(), resulting in a single-statement batch.

Please introduce additional unit tests analogous to the current new ones but with multiple statements (e.g., 2) per batch update, and verify setObject(...) is invoked with the right values for both rows in order, plus containsExactly(...).

@quaff

quaff commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

The new tests in JdbcClientIntegrationTests use add() more than once, resulting in a multi-statement batch update. However, the new unit tests in JdbcClientIndexedParameterTests and JdbcClientNamedParameterTests only have a single add(), resulting in a single-statement batch.

Please introduce additional unit tests analogous to the current new ones but with multiple statements (e.g., 2) per batch update, and verify setObject(...) is invoked with the right values for both rows in order, plus containsExactly(...).

Updated tests with @ParameterizedTest.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Sep 22, 2026
@quaff
quaff force-pushed the patch-154 branch 3 times, most recently from 57e1929 to 689f95b Compare September 22, 2026 07:37
Add missing methods:
1. `param(int jdbcIndex, @nullable Object value)`
2. `param(int jdbcIndex, @nullable Object value, int sqlType)`
3. `param(String name, @nullable Object value, int sqlType)`

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>

This branch has not been deployed

No deployments
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) status: feedback-provided Feedback has been provided type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants