-1

I've noticed that the delete method of the GenericService as shown in the Neo4j OGM docs, http://neo4j.com/docs/ogm/java/stable/ returns void. It is the same for the various delete methods of the CrudRepository of SDN (http://docs.spring.io/spring-data/data-neo4j/docs/4.0.0.RELEASE/api/). Even the session.delete method returns a void.

Why is it so? Won't a return type of int (as to how many nodes were deleted) or a boolean (specifying if the delete operation succeeded or not) would've been better?

user207421
  • 305,947
  • 44
  • 307
  • 483
mmwaikar
  • 655
  • 4
  • 14
  • Because that's the way they designed it. These questions are always incomprehensible. Are you expecting SO to behave like a hotline to the Neo design team? And what difference will it make to your life to know the answer? – user207421 Oct 08 '15 at 09:29
  • I understand, but I asked this question on Neo4j Slack group but didn't get a reply. What I was looking for is if they plan to change it in future versions or do they think this design is superior? – mmwaikar Oct 08 '15 at 09:31
  • So, again, why are you asking here? SO is *not* a hotline to the Neo design team. – user207421 Oct 08 '15 at 09:32

1 Answers1

1

From my point of view OGM does't return boolean, because the success or failure is handled by transaction itself.

About the information how many nodes was affected with delete. You providing information what you want to delete, then you already have that information.

If you want to add some new feature to OGM, please open an pull request or issue on GitHub - https://github.com/neo4j/neo4j-ogm/issues

MicTech
  • 42,457
  • 14
  • 62
  • 79