From ee513b2f227ba47bfb7eb86322d82d9f3cb75dce Mon Sep 17 00:00:00 2001 From: "Yangkai.Shen" <237497819@qq.com> Date: Tue, 25 Dec 2018 10:07:50 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20spring-boot-demo-neo4j=20=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../neo4j/payload/TeacherStudent.java | 34 +++++++++++++++++++ .../neo4j/repository/StudentRepository.java | 24 ++++++++++++- .../xkcoding/neo4j/service/NeoService.java | 23 ++++++++++++- .../java/com/xkcoding/neo4j/Neo4jTest.java | 12 +++++++ 4 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 spring-boot-demo-neo4j/src/main/java/com/xkcoding/neo4j/payload/TeacherStudent.java diff --git a/spring-boot-demo-neo4j/src/main/java/com/xkcoding/neo4j/payload/TeacherStudent.java b/spring-boot-demo-neo4j/src/main/java/com/xkcoding/neo4j/payload/TeacherStudent.java new file mode 100644 index 0000000..57eca84 --- /dev/null +++ b/spring-boot-demo-neo4j/src/main/java/com/xkcoding/neo4j/payload/TeacherStudent.java @@ -0,0 +1,34 @@ +package com.xkcoding.neo4j.payload; + +import com.xkcoding.neo4j.model.Student; +import lombok.Data; +import org.springframework.data.neo4j.annotation.QueryResult; + +import java.util.List; + +/** + *
+ * 师生关系 + *
+ * + * @package: com.xkcoding.neo4j.payload + * @description: 师生关系 + * @author: yangkai.shen + * @date: Created in 2018-12-24 19:18 + * @copyright: Copyright (c) 2018 + * @version: V1.0 + * @modified: yangkai.shen + */ +@Data +@QueryResult +public class TeacherStudent { + /** + * 教师姓名 + */ + private String teacherName; + + /** + * 学生信息 + */ + private List
@@ -163,4 +165,23 @@ public class NeoService {
return result;
}
+
+ /**
+ * 查询所有师生关系,包括班主任/学生,任课老师/学生
+ *
+ * @return 师生关系
+ */
+ public Map