Duplicate Relationships Using Spring boot

How we can prevent duplicate relationships when do multiple ingestion with same data?

I am using Spring boot ReactiveNeo4jRepository to save node with relationships, if ingesting same data multiple time nodes are unique but relationship between nodes creates multiple for each ingestion .

Using ReactiveNeo4jRepository saveAll(List entity) method

When i check the logs it always runs create cypher query for both node and relationship, but during create node it check node already exist or not but for the relationship it not check

I didn’t see to enable all the time “MERGE” query instead of CREATE

I recall reading that it saves the data by recreating the domain entity every time, thus the use of create. This makes it easier not to have to figure out the difference between old an new.

Do you have an ID property for your relationships and are you preserving the ID after initial save assigns it, so it is the same for each subsequent save.

Thank you for the response Gary,
I am using @ RelationshipId in relationship class as id parameter and also that relationship have multiple properties so @ RelationshipProperties used in class level and @ TargetNode use in parameter level for end node

Every ingestion i noticed new id value for relationship , that id cannot able to set manually as well

Can you post your domain entities?