Skip to content
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

Add support for Spring Data JDBC #14489

Closed
schauder opened this issue Sep 17, 2018 · 7 comments
Closed

Add support for Spring Data JDBC #14489

schauder opened this issue Sep 17, 2018 · 7 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@schauder
Copy link
Contributor

The Spring Data JDBC module is approaching its first GA release and I’m wondering what would be the best approach to get Spring Boot support for it.
Relevant resources are:
https://github.com/spring-projects/spring-data-jdbc
https://spring.io/admin/blog/3396-introducing-spring-data-jdbc

A long time ago we created a boot starter for it, which I didn’t update for a long time and which is broken right now: https://github.com/schauder/spring-data-jdbc-boot-starter

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 17, 2018
@philwebb philwebb changed the title Support for Spring Data JDBC Add support for Spring Data JDBC Sep 17, 2018
@philwebb
Copy link
Member

It looks like it won't be too hard to add this. The only slight problem is the naming of the starter since we already have JDBC support without Spring Data.

@philwebb philwebb added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 17, 2018
@philwebb philwebb added this to the 2.1.x milestone Sep 17, 2018
@philwebb philwebb added the for: team-attention An issue we'd like other members of the team to review label Sep 17, 2018
@snicoll
Copy link
Member

snicoll commented Sep 19, 2018

spring-boot-starter-jdbc and spring-boot-starter-data-jdbc look like obvious candidates to me. Exposing that on start.spring.io is not that obvious though (if we decide to do so).

@schauder
Copy link
Contributor Author

I think it should have data-jdbc in the name spring + jdbc without data typically refers to JdbcTemplate & Co

@wilkinsona
Copy link
Member

Indeed, and that is what @snicoll has proposed. We already have spring-boot-starter-jdbc and the new starter would be named spring-boot-starter-data-jdbc.

We probably also want a test slice annotation for Data JDBC to go alongside @DataJpaTest, @DataMongTest etc. We already have @JdbcTest for plain JDBC testing. @DataJdbcTest avoids a clash and matches the convention of the other Spring Data-related testing annotations.

@snicoll snicoll removed the for: team-attention An issue we'd like other members of the team to review label Sep 19, 2018
@wilkinsona wilkinsona self-assigned this Sep 20, 2018
@wilkinsona
Copy link
Member

I think I've found a bug when multiple Spring Data stores are on the classpath:

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdbcMappingContext' defined in class path resource [org/springframework/boot/autoconfigure/data/jdbc/JdbcRepositoriesAutoConfiguration$SpringBootJdbcConfiguration.class]: Unsatisfied dependency expressed through method 'jdbcMappingContext' parameter 1; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'org.springframework.data.convert.CustomConversions' available: expected single matching bean but found 3: jdbcCustomConversions,mongoCustomConversions,redisCustomConversions
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:767)
    …

I've raised it with the Spring Data team and am awaiting their input.

@wilkinsona wilkinsona added the status: blocked An issue that's blocked on an external project change label Sep 20, 2018
@wilkinsona
Copy link
Member

@wilkinsona wilkinsona removed the status: blocked An issue that's blocked on an external project change label Sep 21, 2018
@wilkinsona wilkinsona modified the milestones: 2.1.x, 2.1.0.M4 Sep 21, 2018
@Sreekanth552
Copy link

What is the solution other than raising

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

6 participants