Skip to content

Add auto-configuration for JdbcClient #36579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mhalbritter opened this issue Jul 26, 2023 · 2 comments
Closed

Add auto-configuration for JdbcClient #36579

mhalbritter opened this issue Jul 26, 2023 · 2 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@mhalbritter
Copy link
Contributor

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);
	}

}
@mhalbritter mhalbritter added the type: enhancement A general enhancement label Jul 26, 2023
@mhalbritter mhalbritter added this to the 3.2.x milestone Jul 26, 2023
@snicoll snicoll self-assigned this Aug 1, 2023
snicoll added a commit to snicoll/spring-boot that referenced this issue Aug 1, 2023
snicoll added a commit to snicoll/spring-boot that referenced this issue Aug 2, 2023
snicoll added a commit to snicoll/spring-boot that referenced this issue Aug 3, 2023
@snicoll snicoll closed this as completed in 38dbc64 Aug 9, 2023
@wilkinsona wilkinsona modified the milestones: 3.2.x, 3.2.0-M2 Aug 9, 2023
@philwebb philwebb reopened this Aug 14, 2023
@philwebb
Copy link
Member

Reopening as I think we need a MyBean.kt file for the docs.

snicoll added a commit that referenced this issue Aug 14, 2023
@snicoll
Copy link
Member

snicoll commented Aug 14, 2023

Added in 3835e25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants