In a microservice-based application I use JPA and MongoDb.
I need to specialise the RepositoryFactoryBean classes to add my own RepositoryProxyPostProcessor.
To achieve this, I use the following annotations:
- @EnableJpaRepositories(repositoryFactoryBeanClass = MyJpaRepositoryFactoryBean.class)
I succeeded with JPA overwriting the JpaRepositoryFactoryBean.createRepositoryFactory() method.
I fail with Mongo as the MongoRepositoryFactoryBean.createRepositoryFactory() method is declared as final. The only way to do it is to completely rewrite the RepositoryFactoryBeanSupport.afterPropertiesSet() method.
I think it should not be final to authorize easy customization. I suggest this small change.
Could MongoRepositoryFactoryBean.createRepositoryFactory final keyword be removed ?