Skip to content

Allow user to replace auto-configured Spring Data JDBC beans with their own #32571

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
snicoll opened this issue Oct 3, 2022 · 1 comment
Closed
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Oct 3, 2022

Spring Data JDBC does not have a JdbcDataConfiguration. Rather we only have an auto-configuration for the repositories support that brings an extension of org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration. I've noticed this when looking at the ManagedTypes support new for replacing classpath scanning in AOT scenario.

@snicoll snicoll added for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Oct 3, 2022
@wilkinsona wilkinsona changed the title Auto-configuration for Spring Data JDBC is inconsistent Allow user to replace auto-configured Spring Data JDBC beans with their own Oct 4, 2022
@wilkinsona
Copy link
Member

wilkinsona commented Oct 4, 2022

Having discussed this with @mp911de, the main problem is that Boot sub-classing AbstractJdbcConfiguration prevents users from providing their own replacement for any of the beans that it defines. We can overcome this by overriding the inherited @Bean methods and annotating them with @ConditionalOnMissingBean as EnableWebMvcConfiguration already does in a few places for some of MVC's beans. This approach will make things more flexible for users while avoiding having to duplicate the moderately complex logic in the @Bean methods of AbstractJdbcConfiguration.

@wilkinsona wilkinsona added type: enhancement A general enhancement and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Oct 4, 2022
@wilkinsona wilkinsona added this to the 3.0.x milestone Oct 4, 2022
@wilkinsona wilkinsona self-assigned this Oct 4, 2022
@wilkinsona wilkinsona modified the milestones: 3.0.x, 3.0.0-RC1 Oct 5, 2022
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

2 participants