CypherdslStatementExecutor.findAll ordering using projection

Am trying to using the following CypherdslStatementExecutor.findAll method to get a sorted page of results using a Projection class

    Page<MyProjection> page = repository.findAll(ongoingReadingAndReturn, countQuery, pageable, MyProjection.class);

The query is working fine but cannot order by properties of the projection class, getting error: "Cannot order by the unknown graph property: ...".

Am putting together a small example but thought I'd first ask in case this is a known limitation.

The property needs to exist in the domain class itself. Or even more specific: In the class the repository is typed for.
Example: If you have A extends B and P as projection for A. With a Repository extends CypherdslStatementExecutor<B>, ... it would be only possible to use the properties of B.
It cannot use A's or P's properties here because this wouldn't be valid for all possible child classes of B.

@gerrit.meier Bugger, that's not what I wanted to hear :frowning:

Is there an alternative to handle the sorting? We had it working ok using cypher (using :#{orderBy(#pageable)} SKIP $skip LIMIT $limit) and were moving to DSL to clean up lots of conditional WHERE clauses which all worked fine, except for the sorting.

Thanks heaps for the reply though.

You could create an additional repository for the specific type which contains the property.
It is technically not prohibited to create multiple repositories for the same type.