Skip to content

JdbcRepositoryFactoryBean must be restructured to support other Spring modules [DATAJDBC-151] #383

@spring-projects-issues

Description

@spring-projects-issues

Greg Turnquist opened DATAJDBC-151 and commented

When using either Spring Data REST or Spring Boot's DevTools, JdbcRepositoryFactoryBean fails its constructor call due to the additional arguments.

(1) By changing its structure to only accept repositoryInterface in the constructor and having it implement ApplicationContextAware, we are able to get past this issue.

(2) However, there is a further fatal flaw that arises with Spring Data REST. Spring Data REST constructs a bean of type PersistentEntities which is used to interact with the data store. It builds it by looking in the application context for all MappingContexts. Since JdbcRepositoryFactoryBean's JdbcMappingContext is never registered with the application context, this bean ends up with an empty list.

(3) Additionally there are checks performed against the RepositoryFactoryBeanSupport that fail with a NullPointerException due to the mappingContext not being assigned


Issue Links:

Referenced from: pull request #24

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions