Spring Data Neo4j使用下划线创建重复的节点 [英] Spring Data Neo4j Create duplicate nodes with underscore

查看:221
本文介绍了Spring Data Neo4j使用下划线创建重复的节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用spring数据neo4j将节点保留在数据库中时.它会保留重复的节点,例如"person"和"_person".它们都包含相同的数据.所以我想停止sdn的这种行为.

When i am persisting nodes in database using spring data neo4j. it persist duplicate nodes like "person" and "_person". it both contains same data. so i want to stop this behaviour of sdn.

我没有使用任何继承,只是每个类都具有所有属性.

I am not using any inheritance and simply each class is having all properties.

如果我直接从neo4j服务器插入数据,sdn也无法获取.

Also if i insert data from neo4j server directly ,sdn is not getting it.

推荐答案

未复制节点(在游览示例person和_person上应该看到相同的节点ID).您将看到SDN用来启用类映射的类型表示策略.

The nodes are not being duplicated (you should see the same node ID on tour example person and _person). What you are seeing is the type representation strategy used by SDN to enable the class mapping.

我记不清了,但是我认为您将为Java类型层次结构中的每个类获得一个标签,并为Node的具体Java类型获得一个带下划线前缀的标签.

I cannot remember exactly but I think you will get a label for each class in your Java type hierarchy and one underscore prefixed label for the concrete java type of the Node.

您可以通过提供自己的索引编制策略来更改此行为,请参见此处的文档.

You can change this behaviour by providing your own indexing strategy, see the documentation here.

这篇关于Spring Data Neo4j使用下划线创建重复的节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆