对于一个学校项目,我们尝试使用 Spring Boot 和 Spring 数据在 Neo4j 中建立家谱。截至目前,我们能够返回所有已连接节点的列表。然而,我们留下了一组空的关系。 Spring 给了我们一个应该代表节点的对象数组,但它们都是空的。
[{
"id": 88,
"uuid": "790f0720-59f6-49ee-b444-7bea92c158b6",
"name": "Bert",
"sex": "M",
"birthYear": 1478513136564,
"deathYear": 1478513136564,
"city": "Groningen",
"causeOfDeath": "",
"ownerId": "d82917ee-a4b2-405e-ac0b-ee06188d7fb2",
"note": "test",
"married": [
{}
],
"children": [
{},
{},
{}
]}
我们受困于未显示的关系。我们如何才能获取这些关系?
我们正在使用
public interface GenogramDao extends GraphRepository<Person> {
}
和
@RequestMapping("/findall")
public Iterable<Person> allAsList() {
return dao.findAll();
}
最佳答案
您是否尝试过为 Marrige 对象创建 getter 和 setter?
关于java - Neo4J 和 Spring 返回空关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40462851/