Package org.springframework.data.repository.query.parser

Examples of org.springframework.data.repository.query.parser.PartTree$OrPart


   * @see DATAMONGO-566
   */
  @Test
  public void shouldCreateDeleteByQueryCorrectlyForMultipleCriteriaAndCaseExpressions() {

    PartTree tree = new PartTree("deleteByFirstNameAndAgeAllIgnoreCase", Person.class);
    MongoQueryCreator creator = new MongoQueryCreator(tree, getAccessor(converter, "dave", 42), context);

    Query query = creator.createQuery();

    assertThat(tree.isDelete(), is(true));
    assertThat(query, is(query(where("firstName").regex("^dave$", "i").and("age").is(42))));
  }
View Full Code Here


    super(method, metadata, simpleDbDomain);
   
    final String domainName = simpleDbDomain.getDomain(metadata.getDomainType());
    final SimpleDbEntityInformation<?, ?> entityInformation = SimpleDbEntityInformationSupport.getMetadata(metadata.getDomainType(), domainName);
   
    whereExpression = PartTreeConverter.toIndexedQuery(new PartTree(method.getName(), entityInformation.getJavaType()));
  }
View Full Code Here

  }

  @Test
  public void createsQueryForSimplePropertyReferenceCorrectly() {

    PartTree partTree = new PartTree("findByFirstname", Person.class);
    GemfireQueryCreator creator = new GemfireQueryCreator(partTree, entity);

    QueryString query = creator.createQuery();
    assertThat(query.toString(), is("SELECT * FROM /simple x WHERE x.firstname = $1"));
  }
View Full Code Here

    super(method);

    Class<?> domainClass = method.getEntityInformation().getJavaType();

    this.tree = new PartTree(method.getName(), domainClass);
    this.method = method;
    this.template = template;
  }
View Full Code Here

    Assert.assertEquals("name:mail OR description:domain AND last_modified:{2012\\-10\\-15T05\\:31\\:00.000Z TO *]",
        queryParser.getQueryString(query));
  }

  private Query createQueryForMethodWithArgs(Method method, Object[] args) {
    PartTree partTree = new PartTree(method.getName(), method.getReturnType());
    SolrQueryMethod queryMethod = new SolrQueryMethod(method, metadataMock, entityInformationCreatorMock);
    SolrQueryCreator creator = new SolrQueryCreator(partTree, new SolrParametersParameterAccessor(queryMethod, args),
        mappingContext);

    return creator.createQuery();
View Full Code Here

    public DerivedCypherRepositoryQuery(Neo4jMappingContext mappingContext, GraphQueryMethod queryMethod, Neo4jTemplate template) {
        super(queryMethod, template);
        Assert.notNull(mappingContext);

        EntityMetadata<?> info = queryMethod.getEntityInformation();
        PartTree tree = new PartTree(queryMethod.getName(), info.getJavaType());

        this.query = new CypherQueryCreator(tree, mappingContext, info.getJavaType(),template).createQuery();
        if (log.isDebugEnabled()) log.debug("Derived query: "+query+ "from method "+queryMethod);
    }
View Full Code Here

      for (IMethod method : information.getMethodsToValidate()) {

        String methodName = method.getElementName();

        try {
          new PartTree(methodName, domainClass);
        } catch (PropertyReferenceException e) {
          problems.add(new InvalidDerivedQueryProblem(method, e.getMessage()));
        }
      }
View Full Code Here

      for (IMethod method : information.getMethodsToValidate()) {

        String methodName = method.getElementName();

        try {
          new PartTree(methodName, domainClass);
        } catch (PropertyReferenceException e) {
          element.setElementSourceLocation(new JavaModelSourceLocation(
              method));
          ValidationProblemAttribute start = new ValidationProblemAttribute(
              IMarker.CHAR_START, method.getNameRange()
View Full Code Here

    private final MappingContext<?, ElasticsearchPersistentProperty> mappingContext;


    public ElasticsearchPartQuery(ElasticsearchQueryMethod method, ElasticsearchOperations elasticsearchOperations) {
        super(method, elasticsearchOperations);
        this.tree = new PartTree(method.getName(), method.getEntityInformation().getJavaType());
        this.mappingContext = elasticsearchOperations.getElasticsearchConverter().getMappingContext();
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.repository.query.parser.PartTree$OrPart

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.