Skip to content

The result of org.springframework.data.mapping.PropertyPath.from is incorrect #9962

Closed
@kizimini

Description

@kizimini
    String path = "bbsCc.Name";
    PropertyPath from = PropertyPath.from(path, Aa.class);
    System.out.println(from.toString());  // => Aa.bbs.name, The correct result should be Aa.bbs.cc.name

PropertyPath.java

    private static PropertyPath create(String source, Stack<PropertyPath> base) {
      
    	PropertyPath previous = base.peek(); // => PropertyPath previous = base.peek().getLeafProperty();
    
    	PropertyPath propertyPath = create(source, previous.type, base);
    	previous.next = propertyPath;
    	return propertyPath;
    }

class

    class Aa{
      private String name;
      private Set<Bb> bbs;
      ...setter/getter...
    }
    class Bb {
      private String name;
      private Cc cc;
      ...setter/getter...
    }
    class Cc {
      private String name;
      ...setter/getter...
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions