How to use projection with findAll()


(Toulouse Sabrina) #1

Hi,

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: org.springframework.data.mapping.PropertyReferenceException: 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:
Thx


(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 https://jira.spring.io/browse/DATAGRAPH-1183 and are currently working on this.