Spring 弹簧数据Neo4j-findAll()不';t返回已排序的结果

Spring 弹簧数据Neo4j-findAll()不';t返回已排序的结果,spring,neo4j,spring-data-neo4j,Spring,Neo4j,Spring Data Neo4j,我试图使用带有排序属性的PageRequest使用GraphRespository的findAll(),但出于某些原因,我的数据没有以排序方式返回。这是我的密码: public class Playground { /** * @param args */ public static void main(String[] args) { AnnotationConfigApplicationContext context = new Anno

我试图使用带有排序属性的PageRequest使用GraphRespository的findAll(),但出于某些原因,我的数据没有以排序方式返回。这是我的密码:

public class Playground {

    /**
     * @param args
     */
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(DefaultApplicationConfig.class);
        SocialRescueManager manager = (SocialRescueManager)context.getBean("socialRescueManager");

        manager.Civilians.deleteAll();

        manager.Civilians.save(new Civilian("B", "lastName1", Nationality.USA, EyeColor.BLUE, HairColor.BLOND, 180, new DateTime(1984, 1 , 9, 0, 0)));
        manager.Civilians.save(new Civilian("C", "lastName2", Nationality.USA, EyeColor.GREEN, HairColor.BLACK, 170, new DateTime(1985, 6 , 9, 0, 0)));
        manager.Civilians.save(new Civilian("A", "lastName3", Nationality.USA, EyeColor.BLUE, HairColor.BLOND, 175, new DateTime(1990, 10 , 23, 0, 0)));

        Pageable pageable = new PageRequest(0, 5, Direction.DESC, "firstName");

        Page<Civilian> results = manager.Civilians.findAll(pageable);

        for(Iterator<Civilian> i = results.iterator(); i.hasNext(); ) {
            Civilian civilian = i.next();
            System.out.println(civilian.getFirstName());
            System.out.println(civilian.getDateOfBirth());
        }

        context.close();
    }
}
民用类扩展了Profile类,如下所示:

@NodeEntity
public class Civilian extends Profile {

    @GraphProperty(propertyType = Long.class)
    DateTime dateOfBirth;

    public Civilian() {
    }

    public Civilian(String firstName, String lastName, Nationality nationality, EyeColor eyeColor, HairColor hairColor, int height, DateTime dateOfBirth) {
        super(firstName, lastName, nationality, eyeColor, hairColor, height);
        this.setDateOfBirth(dateOfBirth);
    }

    public DateTime getDateOfBirth() {
        return dateOfBirth;
    }

    public void setDateOfBirth(DateTime dateOfBirth) {
        this.dateOfBirth = dateOfBirth;
    }   
}
public abstract class Profile extends AbstractEntity {

    @Indexed(indexType = IndexType.FULLTEXT, indexName = "firstName")
    String firstName;

    @Indexed(indexType = IndexType.FULLTEXT, indexName = "lastName")
    String lastName;

    @Indexed
    EyeColor eyeColor;

    @Indexed    
    HairColor hairColor;

    @Indexed
    Nationality nationality;

    @Indexed
    int height;

    public Profile() {

    }

    public Profile(String firstName, String lastName, Nationality nationality, EyeColor eyeColor, HairColor hairColor, int height) {
        this.setFirstName(firstName);
        this.setLastName(lastName);
        this.setNationality(nationality);
        this.setHairColor(hairColor);
        this.setEyeColor(eyeColor);
        this.setHeight(height);
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public EyeColor getEyeColor() {
        return eyeColor;
    }

    public void setEyeColor(EyeColor eyeColor) {
        this.eyeColor = eyeColor;
    }

    public HairColor getHairColor() {
        return hairColor;
    }

    public void setHairColor(HairColor hairColor) {
        this.hairColor = hairColor;
    }

    public Nationality getNationality() {
        return nationality;
    }

    public void setNationality(Nationality nationality) {
        this.nationality = nationality;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }
}
因此,我的Main()方法的结果如下:

B
1984-01-09T00:00:00.000+02:00
C
1985-06-09T00:00:00.000+03:00
A
1990-10-23T00:00:00.000+02:00
但正如您所看到的,我将PageRequest对象设置为按“firstName”属性按DESC顺序对结果进行排序,因此我希望先打印C,然后打印B,最后打印A

我做错了什么


谢谢。

Crudepository.findAll(可分页)的javadoc声明:

注意:排序尚未实现

<>你必须贡献一个修复,或者你不妨考虑使用排序启用的CypER查询。例如

START n=node:firstName('firstName:abc')
RETURN n
ORDER BY n.firstName DESC

crudepository.findAll(可分页)
的javadoc声明:

注意:排序尚未实现

<>你必须贡献一个修复,或者你不妨考虑使用排序启用的CypER查询。例如

START n=node:firstName('firstName:abc')
RETURN n
ORDER BY n.firstName DESC

有人知道现在是否实施了吗?有人知道现在是否实施了吗?