Package org.springframework.data.mapping

Examples of org.springframework.data.mapping.PropertyPath


     *
     * @return
     */
    public Predicate build() {

      PropertyPath property = part.getProperty();
      Expression<Object> path = toExpressionRecursively(root, property);

      switch (part.getType()) {
      case BETWEEN:
        ParameterMetadata<Comparable> first = provider.next(part);
View Full Code Here


    CriteriaBuilder builder = em.getCriteriaBuilder();
    CriteriaQuery<User> query = builder.createQuery(User.class);
    Root<User> from = query.from(User.class);

    PropertyPath managerFirstname = PropertyPath.from("manager.firstname", User.class);
    PropertyPath managerLastname = PropertyPath.from("manager.lastname", User.class);

    QueryUtils.toExpressionRecursively(from, managerLastname);
    QueryUtils.toExpressionRecursively(from, managerFirstname);

    assertThat(from.getJoins(), hasSize(1));
View Full Code Here

   * @see DATAMONGO-347
   */
  @Test
  public void createsDBRefWithClientSpecCorrectly() {

    PropertyPath path = PropertyPath.from("person", PersonClient.class);
    MongoPersistentProperty property = mappingContext.getPersistentPropertyPath(path).getLeafProperty();

    Person person = new Person();
    person.id = "foo";

View Full Code Here

     */
    private PersistentPropertyPath<MongoPersistentProperty> getPath(String pathExpression) {

      try {

        PropertyPath path = PropertyPath.from(pathExpression, entity.getTypeInformation());
        PersistentPropertyPath<MongoPersistentProperty> propertyPath = mappingContext.getPersistentPropertyPath(path);

        Iterator<MongoPersistentProperty> iterator = propertyPath.iterator();
        boolean associationDetected = false;

View Full Code Here

        variableContext = new VariableContext();
    }

    @Test
    public void buildsMatchExpressionForSimpleTraversalCorrectly() {
        PropertyPath path = PropertyPath.from("group", Person.class);
        MatchClause clause = new MatchClause(context.getPersistentPropertyPath(path));
        assertThat(clause.toString(variableContext), is("person<-[:members]-person_group"));
    }
View Full Code Here

    }

    @Test
    public void createsMatchClassForDeepTraversal() {

        PropertyPath path = PropertyPath.from("group.members.age", Person.class);
        MatchClause clause = new MatchClause(context.getPersistentPropertyPath(path));
        assertThat(clause.toString(variableContext), is("person<-[:members]-person_group-[:members]->person_group_members"));
    }
View Full Code Here

    }

    @Test
    public void stopsAtNonRelationShipPropertyPath() {

        PropertyPath path = PropertyPath.from("group.name", Person.class);
        MatchClause clause = new MatchClause(context.getPersistentPropertyPath(path));
        assertThat(clause.toString(variableContext), is("person<-[:members]-person_group"));
    }
View Full Code Here

        assertThat(context.getVariableFor(gropPath),is("person_group"));
    }

    private PersistentPropertyPath<Neo4jPersistentProperty> getPath(String expression) {

        PropertyPath path = PropertyPath.from(expression, Person.class);
        return mappingContext.getPersistentPropertyPath(path);
    }
View Full Code Here

    if (!isCompletePathMatch()) {
      return null;
    }

    PropertyPath current = path;
    int index = path.getSegment().length();

    while (current.hasNext()) {
      current = current.next();
      index += current.getSegment().length();
    }

    return source.length() == index ? null : source.substring(index);
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.mapping.PropertyPath

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.