How to use projection with findAll()

(Toulouse Sabrina) #1


I try to add a method to my Neo4jRepository to find all nodes of a certain label, but I need to use a Projection because I don't want all data, but I cannot find a syntax that fits :

public List<PatternPreview> findAllProjectedBy();
This gives NullPointerException, I think because I don't have anything behind "By" (this one used to work with relational DB like Mysql that I used previously)

public List<PatternPreview> findAllProjected();
This gives Caused by: No property findAllProjected found for type Pattern!

public List<PatternPreview> findAll();
And this does not compile as it says The return type is incompatible with Neo4jRepository<Pattern,String>.findAll()

I would apreciate a hint :slight_smile:

(Gerrit Meier) #3

This is definitely a limitation right now in Spring Data Neo4j. But good news are, thanks to your question, we created an issue and are currently working on this.