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

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

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

origin: apache/ignite

/** {@inheritDoc} */
@Override protected RepositoryMetadata getRepositoryMetadata(Class<?> repoItf) {
  Assert.notNull(repoItf, "Repository interface must be set.");
  Assert.isAssignable(IgniteRepository.class, repoItf, "Repository must implement IgniteRepository interface.");
  RepositoryConfig annotation = repoItf.getAnnotation(RepositoryConfig.class);
  Assert.notNull(annotation, "Set a name of an Apache Ignite cache using @RepositoryConfig annotation to map " +
    "this repository to the underlying cache.");
  Assert.hasText(annotation.cacheName(), "Set a name of an Apache Ignite cache using @RepositoryConfig " +
    "annotation to map this repository to the underlying cache.");
  repoToCache.put(repoItf, annotation.cacheName());
  return super.getRepositoryMetadata(repoItf);
}
origin: apache/ignite

/** {@inheritDoc} */
@Override protected RepositoryMetadata getRepositoryMetadata(Class<?> repoItf) {
  Assert.notNull(repoItf, "Repository interface must be set.");
  Assert.isAssignable(IgniteRepository.class, repoItf, "Repository must implement IgniteRepository interface.");
  RepositoryConfig annotation = repoItf.getAnnotation(RepositoryConfig.class);
  Assert.notNull(annotation, "Set a name of an Apache Ignite cache using @RepositoryConfig annotation to map " +
    "this repository to the underlying cache.");
  Assert.hasText(annotation.cacheName(), "Set a name of an Apache Ignite cache using @RepositoryConfig " +
    "annotation to map this repository to the underlying cache.");
  repoToCache.put(repoItf, annotation.cacheName());
  return super.getRepositoryMetadata(repoItf);
}
origin: org.springframework.data/spring-data-commons-core

public RepositoryInformation getRepositoryInformation() {
  RepositoryMetadata metadata = factory.getRepositoryMetadata(repositoryInterface);
  return this.factory.getRepositoryInformation(metadata,
      customImplementation == null ? null : customImplementation.getClass());
}
origin: org.springframework.data/spring-data-commons-core

@SuppressWarnings("unchecked")
public EntityInformation<S, ID> getEntityInformation() {
  RepositoryMetadata repositoryMetadata = factory.getRepositoryMetadata(repositoryInterface);
  return (EntityInformation<S, ID>) factory.getEntityInformation(repositoryMetadata.getDomainType());
}
origin: com.blazebit/blaze-persistence-integration-spring-data

public void afterPropertiesSet() {
  this.factory = createRepositoryFactory();
  this.factory.setQueryLookupStrategyKey(queryLookupStrategyKey);
  this.factory.setNamedQueries(namedQueries);
  this.factory.setEvaluationContextProvider(evaluationContextProvider);
  this.factory.setRepositoryBaseClass(repositoryBaseClass);
  this.factory.setBeanClassLoader(classLoader);
  this.factory.setBeanFactory(beanFactory);
  if (publisher != null) {
    RepositoryProxyPostProcessor repositoryProxyPostProcessor = null;
    try {
      repositoryProxyPostProcessor = (RepositoryProxyPostProcessor) Class.forName("org.springframework.data.repository.core.support.EventPublishingRepositoryProxyPostProcessor").getConstructor(ApplicationEventPublisher.class).newInstance(publisher);
    } catch (Exception e) {
      // ignore
    }
    if (repositoryProxyPostProcessor != null) {
      this.factory.addRepositoryProxyPostProcessor(repositoryProxyPostProcessor);
    }
  }
  this.repositoryMetadata = this.factory.getRepositoryMetadata(repositoryInterface);
  if (!lazyInit) {
    initAndReturn();
  }
}
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: org.springframework.data/spring-data-commons-core

/**
 * Returns a repository instance for the given interface backed by an instance providing implementation logic for
 * custom logic.
 * 
 * @param <T>
 * @param repositoryInterface
 * @param customImplementation
 * @return
 */
@SuppressWarnings({ "unchecked" })
public <T> T getRepository(Class<T> repositoryInterface, Object customImplementation) {
  RepositoryMetadata metadata = getRepositoryMetadata(repositoryInterface);
  Class<?> customImplementationClass = null == customImplementation ? null : customImplementation.getClass();
  RepositoryInformation information = getRepositoryInformation(metadata, customImplementationClass);
  validate(information, customImplementation);
  Object target = getTargetRepository(information);
  // Create proxy
  ProxyFactory result = new ProxyFactory();
  result.setTarget(target);
  result.setInterfaces(new Class[] { repositoryInterface, Repository.class });
  for (RepositoryProxyPostProcessor processor : postProcessors) {
    processor.postProcess(result);
  }
  result.addAdvice(new QueryExecutorMethodInterceptor(information, customImplementation, target));
  return (T) result.getProxy();
}
origin: apache/servicemix-bundles

Assert.notNull(fragments, "RepositoryFragments must not be null!");
RepositoryMetadata metadata = getRepositoryMetadata(repositoryInterface);
RepositoryComposition composition = getRepositoryComposition(metadata, fragments);
RepositoryInformation information = getRepositoryInformation(metadata, composition);
org.springframework.data.repository.core.supportRepositoryFactorySupportgetRepositoryMetadata

Javadoc

Returns the RepositoryMetadata for the given repository interface.

Popular methods of RepositoryFactorySupport

  • setBeanClassLoader
  • getRepository
    Returns a repository instance for the given interface backed by an instance providing implementation
  • 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

  • Creating JSON documents from java classes using gson
  • getContentResolver (Context)
  • getExternalFilesDir (Context)
  • runOnUiThread (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Path (java.nio.file)
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • CodeWhisperer alternatives
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