There are several bits in there that we should talk about.
What you are trying to define is not a Project
projection but something different.
A projection defines a (reduced) view on an entity. This would mean that you can define the properties and relationships of the ProjectEntity
in there but not pull those ones to the first level of the object graph.
Since you are already using a DTO projection (in opposite to an interface projection) you could of course create methods to access the nested attributes and mimic a top-level existence.
If this is not needed, I would always advise you to use interface based projection.
Some more information about projections: Spring Data Neo4j
Secondly, your query does not what it is supposed to do. Because you were mentioning @QueryResult
before I assume that you have used it with Neo4j-OGM.
Neo4j-OGM collects all returned data before the mapping process starts. It is ok with getting bite-size information that eventually forms a complete instance of an entity. SDN 6 does not support this because this would mean that it cannot support the reactive flow, for example.
Every record in the returned result has to define the complete entity.
Looking at your query, this should be something like
MATCH (n:Resource)-[r:RESOURCE_OF]->(m:ProjectEntity) return collect(n) as resource, collect(r) as relation, m as project
This would return project-focused records because the relationships and related nodes are getting returned along with the Project
node.