Tabnine Logo
RepositoryFactorySupport.getRepository
Code IndexAdd Tabnine to your IDE (free)

How to use
getRepository
method
in
org.springframework.data.repository.core.support.RepositoryFactorySupport

Best Java code snippets using org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository (Showing top 9 results out of 315)

origin: org.springframework.data/spring-data-commons-core

/**
 * Returns a repository instance for the given interface.
 * 
 * @param <T>
 * @param repositoryInterface
 * @return
 */
public <T> T getRepository(Class<T> repositoryInterface) {
  return getRepository(repositoryInterface, null);
}
origin: apache/servicemix-bundles

public void afterPropertiesSet() {
  this.factory = createRepositoryFactory();
  this.factory.setQueryLookupStrategyKey(queryLookupStrategyKey);
  this.factory.setNamedQueries(namedQueries);
  this.factory.setEvaluationContextProvider(
      evaluationContextProvider.orElseGet(() -> QueryMethodEvaluationContextProvider.DEFAULT));
  this.factory.setBeanClassLoader(classLoader);
  this.factory.setBeanFactory(beanFactory);
  if (publisher != null) {
    this.factory.addRepositoryProxyPostProcessor(new EventPublishingRepositoryProxyPostProcessor(publisher));
  }
  repositoryBaseClass.ifPresent(this.factory::setRepositoryBaseClass);
  RepositoryFragments customImplementationFragment = customImplementation //
      .map(RepositoryFragments::just) //
      .orElseGet(RepositoryFragments::empty);
  RepositoryFragments repositoryFragmentsToUse = this.repositoryFragments //
      .orElseGet(RepositoryFragments::empty) //
      .append(customImplementationFragment);
  this.repositoryMetadata = this.factory.getRepositoryMetadata(repositoryInterface);
  // Make sure the aggregate root type is present in the MappingContext (e.g. for auditing)
  this.mappingContext.ifPresent(it -> it.getPersistentEntity(repositoryMetadata.getDomainType()));
  this.repository = Lazy.of(() -> this.factory.getRepository(repositoryInterface, repositoryFragmentsToUse));
  if (!lazyInit) {
    this.repository.get();
  }
}
origin: apache/servicemix-bundles

/**
 * Creates the actual repository instance.
 *
 * @param repositoryType will never be {@literal null}.
 * @param repositoryFragments will never be {@literal null}.
 * @return
 */
protected static <T> T create(RepositoryFactorySupport repositoryFactory, Class<T> repositoryType,
    RepositoryFragments repositoryFragments) {
  return repositoryFactory.getRepository(repositoryType, repositoryFragments);
}
origin: org.springframework.data/spring-data-commons-core

public T getObject() {
  return factory.getRepository(repositoryInterface, customImplementation);
}
origin: com.blazebit/blaze-persistence-integration-spring-data

/**
 * Returns the previously initialized repository proxy or creates and returns the proxy if previously uninitialized.
 *
 * @return
 */
private T initAndReturn() {
  Assert.notNull(repositoryInterface, "Repository interface must not be null on initialization!");
  if (this.repository == null) {
    this.repository = this.factory.getRepository(repositoryInterface, customImplementation);
  }
  return this.repository;
}
origin: stackoverflow.com

 public static void main(String[] args) {
ApplicationContext context = new AnnotationConfigApplicationContext(
  CouchBaseBeansConfiguration.class);
CouchbaseTemplate template = context.getBean("couchbaseTemplate",
  CouchbaseTemplate.class);
RepositoryFactorySupport factory = new CouchbaseRepositoryFactory(
  template);
CBsampleRepository repository = factory.getRepository(CBsampleRepository.class,new CBsampleRepositoryImpl());
CBsampleRepository repository = factory.getRepository(CBsampleRepository.class,custom);
repository.addIndex();
}
origin: apache/servicemix-bundles

/**
 * Returns a repository instance for the given interface.
 *
 * @param repositoryInterface must not be {@literal null}.
 * @return
 */
public <T> T getRepository(Class<T> repositoryInterface) {
  return getRepository(repositoryInterface, RepositoryFragments.empty());
}
origin: apache/servicemix-bundles

/**
 * Returns a repository instance for the given interface backed by an instance providing implementation logic for
 * custom logic.
 *
 * @param repositoryInterface must not be {@literal null}.
 * @param customImplementation must not be {@literal null}.
 * @return
 * @deprecated since 2.0. Use {@link RepositoryFragments} with {@link #getRepository(Class, RepositoryFragments)} to
 *             compose repositories backed by custom implementations.
 */
@Deprecated
public <T> T getRepository(Class<T> repositoryInterface, Object customImplementation) {
  return getRepository(repositoryInterface, RepositoryFragments.just(customImplementation));
}
origin: stackoverflow.com

RepositoryFactorySupport factory = applicationContext.getBean(RepositoryCreator.class).getRepositoryFactorySupport();
for (Field f : toInitializeFields) {
  Object bean = factory.getRepository(f.getType());
  f.set(currentObj, bean);
  f.setAccessible(false);
org.springframework.data.repository.core.supportRepositoryFactorySupportgetRepository

Javadoc

Returns a repository instance for the given interface.

Popular methods of RepositoryFactorySupport

  • getRepositoryMetadata
    Returns the RepositoryMetadata for the given repository interface.
  • setBeanClassLoader
  • getTargetRepositoryViaReflection
  • addRepositoryProxyPostProcessor
    Adds RepositoryProxyPostProcessors to the factory to allow manipulation of the ProxyFactory before t
  • getEntityInformation
    Returns the EntityInformation for the given domain class.
  • getQueryMethods
  • getRepositoryInformation
    Returns the RepositoryInformation for the given repository interface.
  • setNamedQueries
    Configures a NamedQueries instance to be handed to the QueryLookupStrategy for query creation.
  • setQueryLookupStrategyKey
    Sets the strategy of how to lookup a query to execute finders.
  • getQueryLookupStrategy
    Returns the QueryLookupStrategy for the given Key.
  • getRepositoryBaseClass
    Returns the base class backing the actual repository instance. Make sure #getTargetRepository(Reposi
  • getTargetRepository
    Create a repository instance as backing for the query proxy.
  • getRepositoryBaseClass,
  • getTargetRepository,
  • setBeanFactory,
  • setEvaluationContextProvider,
  • setRepositoryBaseClass,
  • validate,
  • addQueryCreationListener,
  • getProjectionFactory,
  • getRepositoryComposition

Popular in Java

  • Start an intent from android
  • getSharedPreferences (Context)
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Option (scala)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now