Skip to content

Add auto-configuration for JdbcClient #36579

Closed
@mhalbritter

Description

@mhalbritter

Spring Framework 6.1 introduces the new JdbcClient. We should add an auto-configuration for it.

@jhoeller suggested something like this:

@Configuration(proxyBeanMethods = false)
@ConditionalOnSingleCandidate(NamedParameterJdbcTemplate.class)
@ConditionalOnMissingBean(JdbcClient.class)
class JdbcClientConfiguration {

	@Bean
	@Primary
	JdbcClient jdbcClient(NamedParameterJdbcTemplate jdbcTemplate) {
		return JdbcClient.create(jdbcTemplate);
	}

}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions