spring-data-neo4j icon indicating copy to clipboard operation
spring-data-neo4j copied to clipboard

Support cascades delete

Open abccbaandy opened this issue 1 year ago • 2 comments

As title Current CrudRepository delete only delete node and relation, but not target node.

Is it possible to support cascades delete too?

abccbaandy avatar Aug 06 '24 03:08 abccbaandy

No this is not possible within Spring Data Neo4j. We had some discussion around this, but the problem with cascading deletes is complex to solve if this entity has -for example- other related nodes. Those scenarios can get very challenging because there are very different graphs out there and it is hard to match the expected behaviour for all users. From a user perspective we learned that multiple applications might work with the data in the database and we wanted to be as defensive as possible. Hope this explains why this feature does not exists and we don't want to introduce it.

meistermeier avatar Aug 06 '24 12:08 meistermeier

But someone like me need this. Also since SDN have cascade create/update already, I think provide this feature and default disable will be fine, isn't it?

abccbaandy avatar Aug 06 '24 14:08 abccbaandy