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

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

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

origin: apache/servicemix-bundles

/**
 * Creates a new {@link QueryExecutorMethodInterceptor}. Builds a model of {@link QueryMethod}s to be invoked on
 * execution of repository interface methods.
 */
public QueryExecutorMethodInterceptor(RepositoryInformation repositoryInformation,
    ProjectionFactory projectionFactory) {
  this.resultHandler = new QueryExecutionResultHandler();
  Optional<QueryLookupStrategy> lookupStrategy = getQueryLookupStrategy(queryLookupStrategyKey,
      RepositoryFactorySupport.this.evaluationContextProvider);
  if (!lookupStrategy.isPresent() && repositoryInformation.hasQueryMethods()) {
    throw new IllegalStateException("You have defined query method in the repository but "
        + "you don't have any query lookup strategy defined. The "
        + "infrastructure apparently does not support query methods!");
  }
  this.queries = lookupStrategy //
      .map(it -> mapMethodsToQuery(repositoryInformation, it, projectionFactory)) //
      .orElse(Collections.emptyMap());
}
origin: org.springframework.data/spring-data-commons-core

/**
 * Creates a new {@link QueryExecutorMethodInterceptor}. Builds a model of {@link QueryMethod}s to be invoked on
 * execution of repository interface methods.
 */
public QueryExecutorMethodInterceptor(RepositoryInformation repositoryInformation, Object customImplementation,
    Object target) {
  this.repositoryInformation = repositoryInformation;
  this.customImplementation = customImplementation;
  this.target = target;
  QueryLookupStrategy lookupStrategy = getQueryLookupStrategy(queryLookupStrategyKey);
  Iterable<Method> queryMethods = repositoryInformation.getQueryMethods();
  if (lookupStrategy == null) {
    if (queryMethods.iterator().hasNext()) {
      throw new IllegalStateException("You have defined query method in the repository but "
          + "you don't have no query lookup strategy defined. The "
          + "infrastructure apparently does not support query methods!");
    }
    return;
  }
  for (Method method : queryMethods) {
    RepositoryQuery query = lookupStrategy.resolveQuery(method, repositoryInformation, namedQueries);
    invokeListeners(query);
    queries.put(method, query);
  }
}
org.springframework.data.repository.core.supportRepositoryFactorySupportgetQueryLookupStrategy

Javadoc

Returns the QueryLookupStrategy for the given Key.

Popular methods of RepositoryFactorySupport

  • getRepositoryMetadata
    Returns the RepositoryMetadata for the given repository interface.
  • 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.
  • 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

  • Running tasks concurrently on multiple threads
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JButton (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Best IntelliJ 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