Register custom converters in two independent modules [DATAJDBC-499] #723
Labels
in: repository
Repositories abstraction
status: duplicate
A duplicate of another issue
type: enhancement
A general enhancement
Tom Hombergs opened DATAJDBC-499 and commented
I'm using Spring Data JDBC in two modules of a modular Spring Boot application. I want to build the modules completely self-sufficient so they don't know each other. Each module has its own package, and its own
@Configuration
.Now, I want to register custom converters for each of the modules extending
AbstractJdbcConfiguration
:@Configuration
@ComponentScan
@EnableJdbcRepositories
class PerformanceServiceDatabaseConfiguration extends AbstractJdbcConfiguration {
@Override
public JdbcCustomConversions jdbcCustomConversions() {
return new JdbcCustomConversions(Arrays.asList(
new SiteIdReadingConverter(),
new SiteIdWritingConverter()
));
}
}
(similar for the other module, with different converters)
When I'm starting up the application, only the converters of one of my modules are being loaded. When I'm trying to persist entities from the other modules I get errors.
The tests in each module run fine, because the tests each only load the part of the application context that belongs to the respective module.
Two things to point out:
AbstractJdbcConfiguration
lacks flexibility for modular applications. Is there another way to register converters?AbstractJdbcConfiguration
s in my application context, but it silently ignores one of them.Issue Links:
("duplicates")
The text was updated successfully, but these errors were encountered: