@@ -155,6 +155,12 @@ interface MovieRepository extends Neo4jRepository<Movie, String> {
155155
156156 @ Query ("MATCH (m:Movie{title:'The Matrix'})<-[a:ACTED_IN]-(p:Person) WITH a,p,m order by p.name DESC return m, collect(a), collect(p)" )
157157 Movie findMatrixWithSortedDescActors ();
158+
159+ @ Query ("MATCH p=(:Movie{title:'The Matrix'}) return p" )
160+ Movie findSingleNodeWithPath ();
161+
162+ @ Query ("MATCH p=(m:Movie{title:'The Matrix'})<-[:ACTED_IN]-(:Person) return m, collect(nodes(p)), collect(relationships(p))" )
163+ List <Movie > findMultipleSameTypeRelationshipsWithPath ();
158164 }
159165
160166 @ Test // GH-1906
@@ -469,13 +475,27 @@ void findPreservesOrderFromResultAscInRelationshipList(@Autowired MovieRepositor
469475 .containsExactly ("Carrie-Anne Moss" , "Emil Eifrem" , "Gloria Foster" , "Hugo Weaving" , "Keanu Reeves" ,
470476 "Laurence Fishburne" );
471477 }
478+
472479 @ Test // GH-2458
473480 void findPreservesOrderFromResultDescInRelationshipList (@ Autowired MovieRepository repository ) {
474481 assertThat (repository .findMatrixWithSortedDescActors ().getActors ()).extracting ("person" ).extracting ("name" )
475482 .containsExactly ("Laurence Fishburne" , "Keanu Reeves" , "Hugo Weaving" , "Gloria Foster" , "Emil Eifrem" ,
476483 "Carrie-Anne Moss" );
477484 }
478485
486+
487+ @ Test // GH-2470
488+ void mapPathWithSingleNode (@ Autowired MovieRepository repository ) {
489+ assertThat (repository .findSingleNodeWithPath ()).isNotNull ();
490+ }
491+
492+ @ Test // GH-2473
493+ void mapPathWithMultipleSameTypeRelationships (@ Autowired MovieRepository repository ) {
494+ List <Movie > movies = repository .findMultipleSameTypeRelationshipsWithPath ();
495+ assertThat (movies ).hasSize (1 );
496+ assertThat (movies .get (0 ).getActors ()).hasSize (6 );
497+ }
498+
479499 @ Configuration
480500 @ EnableTransactionManagement
481501 @ EnableNeo4jRepositories (considerNestedRepositories = true )
0 commit comments