org.springframework.data.neo4j.core.mapping.NoRootNodeMappingException: Could not find mappable nodes or relationships inside Record<>

Viewed 352

I'm getting this error when I'm trying to map return values of the query to the DTO:

org.springframework.data.neo4j.core.mapping.NoRootNodeMappingException: Could not find mappable nodes or relationships inside Record<{subjectId: 3649, subjectName: "Environmental Science", chapterId: 4574, chapterName: "Growing Up"}> for org.springframework.data.neo4j.core.mapping.DefaultNeo4jPersistentEntity@51543926

This is my DTO class:

@Value
public class LearnBySubjectIdResponse implements Serializable {
  
   private Long subjectId;
   private String subjectName;
   private Long  chapterId;
   private String chapterName;
   
}

  @Query("MATCH (subjectName:ContainerName)<-[subject_has_name:has_name]-(subject:Container)-[subject_has_child:has_child]-(chapter:Container{cb_rack_id:1579245})-[chapter_has_name:has_name]-(chapterContainerName:ContainerName)\n" +
            "match (chapter)-[chapter_has_content:has_content]->(content:Content)\n" +
            "RETURN subjectName.rack_name_id as subjectId, subjectName.rack_name as subjectName,chapterContainerName.rack_name_id as chapterId, chapterContainerName.name as chapterName;")
    List<LearnBySubjectIdResponse> getChapterContent(@Param("cbRackId") long cbRackId);

0 Answers
Related