Search in sources :

Example 6 with RepositoryFragments

use of org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments in project spring-data-commons by spring-projects.

the class CdiRepositoryBean method create.

/**
 * Creates the actual component instance given a {@link RepositoryFactorySupport repository factory supplier} and the
 * repository {@link Class type}. This method is an utility for to create a repository. This method will obtain a
 * {@link RepositoryFactorySupport repository factory} and configure it with {@link CdiRepositoryConfiguration}.
 *
 * @param factorySupplier must not be {@literal null}.
 * @param repositoryType must not be {@literal null}.
 * @return
 * @since 2.1
 */
protected T create(Supplier<? extends RepositoryFactorySupport> factorySupplier, Class<T> repositoryType) {
    CdiRepositoryConfiguration configuration = lookupConfiguration(beanManager, qualifiers);
    RepositoryFragments repositoryFragments = getRepositoryFragments(repositoryType, configuration);
    RepositoryFactorySupport factory = factorySupplier.get();
    applyConfiguration(factory, configuration);
    return create(factory, repositoryType, repositoryFragments);
}
Also used : RepositoryFragments(org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments) RepositoryFactorySupport(org.springframework.data.repository.core.support.RepositoryFactorySupport)

Aggregations

RepositoryFragments (org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments)6 Serializable (java.io.Serializable)2 Bean (javax.enterprise.inject.spi.Bean)1 InvalidDataAccessApiUsageException (org.springframework.dao.InvalidDataAccessApiUsageException)1 QuerydslPredicateExecutor (org.springframework.data.querydsl.QuerydslPredicateExecutor)1 ReactiveQuerydslPredicateExecutor (org.springframework.data.querydsl.ReactiveQuerydslPredicateExecutor)1 RepositoryFactorySupport (org.springframework.data.repository.core.support.RepositoryFactorySupport)1 RepositoryFragment (org.springframework.data.repository.core.support.RepositoryFragment)1