Hello,
I am using Spring Boot 2.3 M4 with neo4j and I have a strange behaviour of a custom @Query.
I have a Spring Data Repository with a method:
Page<GraphMemberContact> findContactsByUserIdOrderByLastActionAtDesc(UUID id, Pageable page);
where GraphMemberContact is a simple @RelationshipEntity.
If I use this method ==> OK, I get my 5 results.
If I use my own query like this
@Query(value = "MATCH (n:GraphUser) WHERE n.id = $0 MATCH (n)-[r0:MEMBER_CONTACT]->(m) WITH DISTINCT(r0) as r0,startnode(r0) AS n, endnode(r0) AS m ORDER BY m.activity DESC, r0.createdAt DESC RETURN r0 ",
countQuery = "MATCH (n:GraphUser) WHERE n.id = $0 MATCH (n)-[r0:MEMBER_CONTACT]->(m) WITH DISTINCT(r0) as r0,startnode(r0) AS n, endnode(r0) AS m RETURN count(r0)")
Page<GraphMemberContact> findContactsByUserId(UUID id, Pageable page);
, well I got no result!
But, if I call the default method graphMemberContactRepository.findAll(); juste before calling my custom my query, it's get working !!
If execute my custom query directly in Neo4j, it's working too.
Is there some kind of entity cache somewhere that's is not refresh when I used custom query ??