Package org.springframework.data.repository.query

Examples of org.springframework.data.repository.query.RepositoryQuery


        return;
      }

      for (Method method : queryMethods) {
        RepositoryQuery query = lookupStrategy.resolveQuery(method, repositoryInformation, namedQueries);
        invokeListeners(query);
        queries.put(method, query);
      }
    }
View Full Code Here


    if (!hasNamedQuery(em, queryName)) {
      return null;
    }

    try {
      RepositoryQuery query = new NamedQuery(method, em);
      LOG.debug("Found named query {}!", queryName);
      return query;
    } catch (IllegalArgumentException e) {
      return null;
    }
View Full Code Here

    }

    @Override
    protected RepositoryQuery resolveQuery(JpaQueryMethod method, EntityManager em, NamedQueries namedQueries) {

      RepositoryQuery query = JpaQueryFactory.INSTANCE.fromQueryAnnotation(method, em, this.evaluationContextProvider);

      if (null != query) {
        return query;
      }
View Full Code Here

  }

  @Test
  public void createsASimpleJpaQueryFromAnnotation() throws Exception {

    RepositoryQuery query = createJpaQuery(SampleRepository.class.getMethod("findByAnnotatedQuery"));
    assertThat(query instanceof SimpleJpaQuery, is(true));
  }
View Full Code Here

  }

  @Test
  public void createsANativeJpaQueryFromAnnotation() throws Exception {

    RepositoryQuery query = createJpaQuery(SampleRepository.class.getMethod("findNativeByLastname", String.class));
    assertThat(query instanceof NativeJpaQuery, is(true));
  }
View Full Code Here

    ParametersParameterAccessor parameterAccessor = new ParametersParameterAccessor(method.getParameters(), parameters);

    QueryString query = new GemfireQueryCreator(tree, method.getPersistentEntity())
      .createQuery(parameterAccessor.getSort());

    RepositoryQuery repositoryQuery = new StringBasedGemfireRepositoryQuery(query.toString(), method, template);

    return repositoryQuery.execute(prepareStringParameters(parameters));
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.repository.query.RepositoryQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.