DATADOC-189 - Improved extensibility of MongoRepositoryFactoryBean.
Creation of MongoRepositoryFactory is now delegated into a template method that gets a MongoTemplate handed over.
This commit is contained in:
@@ -79,12 +79,22 @@ public class MongoRepositoryFactoryBean<T extends Repository<S, ID>, S, ID exten
|
||||
* #createRepositoryFactory()
|
||||
*/
|
||||
@Override
|
||||
protected RepositoryFactorySupport createRepositoryFactory() {
|
||||
protected final RepositoryFactorySupport createRepositoryFactory() {
|
||||
|
||||
MongoRepositoryFactory factory = new MongoRepositoryFactory(template);
|
||||
RepositoryFactorySupport factory = getFactoryInstance(template);
|
||||
factory.addQueryCreationListener(new IndexEnsuringQueryCreationListener(template));
|
||||
return factory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and initializes a {@link RepositoryFactorySupport} instance.
|
||||
*
|
||||
* @param template
|
||||
* @return
|
||||
*/
|
||||
protected RepositoryFactorySupport getFactoryInstance(MongoTemplate template) {
|
||||
return new MongoRepositoryFactory(template);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
||||
Reference in New Issue
Block a user