spring-projects / spring-data-neo4j

Provide support to increase developer productivity in Java when using Neo4j. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
http://spring.io/projects/spring-data-neo4j
Apache License 2.0
831 stars 618 forks source link

Support cascades delete #2932

Open abccbaandy opened 3 months ago

abccbaandy commented 3 months ago

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

Is it possible to support cascades delete too?

meistermeier commented 3 months ago

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.

abccbaandy commented 3 months ago

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?