@@ -94,8 +94,8 @@ private synchronized void cacheRepositoryFactory(String name) {
94
94
95
95
RepositoryFactoryInformation repositoryFactoryInformation = beanFactory .getBean (name ,
96
96
RepositoryFactoryInformation .class );
97
- Class <?> domainType = ClassUtils . getUserClass ( repositoryFactoryInformation . getRepositoryInformation ()
98
- .getDomainType ());
97
+ Class <?> domainType = ClassUtils
98
+ .getUserClass ( repositoryFactoryInformation . getRepositoryInformation (). getDomainType ());
99
99
100
100
RepositoryInformation information = repositoryFactoryInformation .getRepositoryInformation ();
101
101
Set <Class <?>> alternativeDomainTypes = information .getAlternativeDomainTypes ();
@@ -193,6 +193,28 @@ public RepositoryInformation getRepositoryInformationFor(Class<?> domainClass) {
193
193
return information == EMPTY_REPOSITORY_FACTORY_INFO ? null : information .getRepositoryInformation ();
194
194
}
195
195
196
+ /**
197
+ * Returns the {@link RepositoryInformation} for the given repository interface.
198
+ *
199
+ * @param repositoryInterface must not be {@literal null}.
200
+ * @return the {@link RepositoryInformation} for the given repository interface or {@literal null} there's no
201
+ * repository instance registered for the given interface.
202
+ * @since 1.12
203
+ */
204
+ public RepositoryInformation getRepositoryInformation (Class <?> repositoryInterface ) {
205
+
206
+ for (RepositoryFactoryInformation <Object , Serializable > factoryInformation : repositoryFactoryInfos .values ()) {
207
+
208
+ RepositoryInformation information = factoryInformation .getRepositoryInformation ();
209
+
210
+ if (information .getRepositoryInterface ().equals (repositoryInterface )) {
211
+ return information ;
212
+ }
213
+ }
214
+
215
+ return null ;
216
+ }
217
+
196
218
/**
197
219
* Returns the {@link PersistentEntity} for the given domain class. Might return {@literal null} in case the module
198
220
* storing the given domain class does not support the mapping subsystem.
0 commit comments