mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-07 15:39:29 +00:00
Prior to this commit, JdbcClient's BatchSpec bound parameters to a "current" batch entry and separated consecutive entries via add(). That style was error-prone, since a missing add() still compiled but silently merged parameters into a single entry. It also did not lend itself to providing batch parameters dynamically — for example, from an existing collection of domain objects. To address that, this commit replaces the chaining style with self-contained batch entries. BatchSpec now provides entry(...) methods that define a single entry — via a Consumer<BatchEntry> callback, a List of positional parameters, or a Map of named parameters — as well as entries(...) methods that define one entry per parameter object. Such calls can be freely combined within the same batch. The new BatchEntry type exposes only the singular param(...) and paramSource(...) methods. The add() method as well as the param(...), params(...), and paramSource(...) methods have been removed from BatchSpec. Closes gh-37341