use of org.springframework.data.repository.core.support.RepositoryFragment in project spring-data-commons by spring-projects.
the class CdiRepositoryBean method getRepositoryFragments.
private RepositoryFragments getRepositoryFragments(Class<T> repositoryType, CdiRepositoryConfiguration cdiRepositoryConfiguration) {
Optional<Bean<?>> customImplementationBean = getCustomImplementationBean(repositoryType, cdiRepositoryConfiguration);
Optional<Object> customImplementation = customImplementationBean.map(this::getDependencyInstance);
List<RepositoryFragment<?>> repositoryFragments = findRepositoryFragments(repositoryType, cdiRepositoryConfiguration);
RepositoryFragments customImplementationFragment = //
customImplementation.map(//
RepositoryFragments::just).orElseGet(RepositoryFragments::empty);
return //
RepositoryFragments.from(repositoryFragments).append(customImplementationFragment);
}
Aggregations