1

In Spring Data Neo4j I've discovered that fields annotated with @ID, require an ID to be manually set. However, if the field is also annotated with @GeneratedValue it will use the ID generated by the database. This annoyingly overwrites any values manually being set.

I need the best of both world options. I don't particularly want to have to manually generate an ID every time within my application, and just rely on Neo4J to do it, but there are certainly times where I will want to manually set the ID (e.g. in my particular case exporting/importing system data and keep relationships working).

I expect I can set some sort of generator; however, I've been unable to get that to work.

Dan
  • 3,647
  • 5
  • 20
  • 26
Crazy Dino
  • 808
  • 1
  • 8
  • 20

0 Answers0