-
Notifications
You must be signed in to change notification settings - Fork 367
Description
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 MappingContext
s. 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:
-
DATAJDBC-140 Move the assembly from JdbcRepositoryFactoryBean to the JdbcRepositoryFactory
-
DATAJDBC-141 Simplify dependencies for JdbcEntityTemplate similar to DATAJDBC-140
Referenced from: pull request #24