Examples of PartTree


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

    super(method, em);
    this.em = em;

    this.domainClass = method.getEntityInformation().getJavaType();
    this.tree = new PartTree(method.getName(), domainClass);
    this.parameters = method.getParameters();

    this.countQuery = new CountQueryPreparer(parameters.potentiallySortsDynamically());
    this.query = tree.isCountProjection() ? countQuery : new QueryPreparer(parameters.potentiallySortsDynamically());
  }
View Full Code Here

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

  private final PartTree tree;
  private final MappingContext<?, SolrPersistentProperty> mappingContext;

  public PartTreeSolrQuery(SolrQueryMethod method, SolrOperations solrOperations) {
    super(solrOperations, method);
    this.tree = new PartTree(method.getName(), method.getEntityInformation().getJavaType());
    this.mappingContext = solrOperations.getConverter().getMappingContext();
  }
View Full Code Here

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

   * @param template must not be {@literal null}.
   */
  public PartTreeCassandraQuery(CassandraQueryMethod method, CassandraOperations cassandraOperations) {

    super(method, cassandraOperations);
    this.tree = new PartTree(method.getName(), method.getEntityInformation().getJavaType());
    this.context = cassandraOperations.getConverter().getMappingContext();
  }
View Full Code Here

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

  private final PartTree tree;
  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

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

   * @param template must not be {@literal null}.
   */
  public PartTreeMongoQuery(MongoQueryMethod method, MongoOperations mongoOperations) {

    super(method, mongoOperations);
    this.tree = new PartTree(method.getName(), method.getEntityInformation().getJavaType());
    this.isGeoNearQuery = method.isGeoNearQuery();
    this.context = mongoOperations.getConverter().getMappingContext();
  }
View Full Code Here

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

  }

  @Test
  public void createsQueryCorrectly() throws Exception {

    PartTree tree = new PartTree("findByFirstName", Person.class);

    MongoQueryCreator creator = new MongoQueryCreator(tree, getAccessor(converter, "Oliver"), context);
    Query query = creator.createQuery();
    assertThat(query, is(query(where("firstName").is("Oliver"))));
  }
View Full Code Here

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

   */
  @Test
  public void createsAndQueryCorrectly() {

    Person person = new Person();
    MongoQueryCreator creator = new MongoQueryCreator(new PartTree("findByFirstNameAndFriend", Person.class),
        getAccessor(converter, "Oliver", person), context);
    Query query = creator.createQuery();

    assertThat(query, is(query(where("firstName").is("Oliver").and("friend").is(person))));
  }
View Full Code Here

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

  }

  @Test
  public void createsNotNullQueryCorrectly() {

    PartTree tree = new PartTree("findByFirstNameNotNull", Person.class);
    Query query = new MongoQueryCreator(tree, getAccessor(converter), context).createQuery();

    assertThat(query, is(new Query(Criteria.where("firstName").ne(null))));
  }
View Full Code Here

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

  }

  @Test
  public void createsIsNullQueryCorrectly() {

    PartTree tree = new PartTree("findByFirstNameIsNull", Person.class);
    Query query = new MongoQueryCreator(tree, getAccessor(converter), context).createQuery();

    assertThat(query, is(new Query(Criteria.where("firstName").is(null))));
  }
View Full Code Here

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

  }

  @Test
  public void createsLessThanEqualQueryCorrectly() throws Exception {

    PartTree tree = new PartTree("findByAgeLessThanEqual", Person.class);
    MongoQueryCreator creator = new MongoQueryCreator(tree, getAccessor(converter, 18), context);

    Query reference = query(where("age").lte(18));
    assertThat(creator.createQuery(), is(reference));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.