I've been using Spring Data Neo4j 6.x for a project but have now got to a point where it looks like I need to do a .save() with a specific depth, given that child relationships are being nuked on saves a few levels up.
While refactoring some of the DTO objects I noticed that
org/neo4j/ogm/metadata/ClassInfo.java:isPrimaryIndexField() is checking for existence of
@org.neo4j.ogm.annotation.Id; of course given I've been using Spring Boot Data Neo4j all my classes have been annotated with
@org.springframework.data.neo4j.core.schema.Id so this check fails.
What's the accepted / expected pattern then, if I'm persisting objects via both SBD and OGM do I add both SBD and OGM
@Id annotations to the graph Id field?
Edit: I should add it does in fact work, but it just looks wrong to have a field with duplicate
@GeneratedValue annotations from SBD and OGM, so I'm wondering if I've gone down the wrong route that's all ... example of one of the graph models here, corresponding OGM persistence performed here, vanilla SBD persistence here.
Edit 2: Spoke too soon, morning's refactoring has gone to pot a bit given I'm now seeing duplicate relationships as
@Start/EndNode items are being added by OGM and
@TargetNode is being used by SDN. ... feels like I should try and remove OGM and try figure out a different way of committing objects with a specific depth. Will leave above links to specific commits.