I can make required tweaks via:
@EnableR2dbcRepositories(repositoryBaseClass = BaseRepo::class)
but this is too high level. Essentially I override top level method with custom behaviour which needs to be done at R2dbcEntityTemplate.class level so would be great if I could provide custom R2DBC teamplate. I tried declaring bean but it doesn't pick mine, predictably due to being hardcoded in:
/*
* (non-Javadoc)
* @see org.springframework.data.repository.core.support.RepositoryFactorySupport#getTargetRepository(org.springframework.data.repository.core.RepositoryInformation)
*/
@Override
protected Object getTargetRepository(RepositoryInformation information) {
RelationalEntityInformation<?, ?> entityInformation = getEntityInformation(information.getDomainType(),
information);
return getTargetRepositoryViaReflection(information, entityInformation,
new R2dbcEntityTemplate(this.databaseClient, this.dataAccessStrategy), this.converter);
}
Instead of repositoryBaseClass, you can use
@EnableR2dbcRepositories(repositoryFactoryBeanClass = MyR2dbcRepositoryFactoryBean.class)
Then on your MyR2dbcRepositoryFactoryBean you can set your own R2dbcEntityTemplate use the method setEntityOperations
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With