SDN 4 : How to cause SDN 4 to use MERGE rather than CREATE

試著忘記壹切 提交于 2019-12-24 03:50:07

问题


Prior to migrating my project to SDN 4, I used my own custom REST client code which generated Cypher statements of the form:

MERGE (n:LABEL1:LABEL2 {prop1:"val"...})
ON CREATE SET ...
ON MATCH SET ...

This had the desired effect of creating nodes which needed to be created, and updating existing nodes where necessary.

However, using .save(...) on the SDN 4 Neo4jTemplate, only CREATE Cypher statements appear to be generated, resulting in duplicate nodes, where what is desired is new nodes are created if necessary and existing nodes are updated and new relationships are added to existing nodes where possible.

Is there a way to influence the SDN 4 Neo4jTemplate behaviour to use MERGE rather than CREATE?

来源:https://stackoverflow.com/questions/31297127/sdn-4-how-to-cause-sdn-4-to-use-merge-rather-than-create

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!