@@ -319,7 +319,10 @@ public void setApplicationContext(ApplicationContext applicationContext) throws
319
319
this .beanFactory = applicationContext .getAutowireCapableBeanFactory ();
320
320
}
321
321
322
- public CreateRelationshipStatementHolder createStatement (Neo4jPersistentEntity <?> neo4jPersistentEntity , NestedRelationshipContext relationshipContext , Object relatedValue ) {
322
+ public CreateRelationshipStatementHolder createStatement (Neo4jPersistentEntity <?> neo4jPersistentEntity ,
323
+ NestedRelationshipContext relationshipContext ,
324
+ Object relatedValue ,
325
+ boolean isNewRelationship ) {
323
326
324
327
if (relationshipContext .hasRelationshipWithProperties ()) {
325
328
MappingSupport .RelationshipPropertiesWithEntityHolder relatedValueEntityHolder =
@@ -342,18 +345,20 @@ public CreateRelationshipStatementHolder createStatement(Neo4jPersistentEntity<?
342
345
}
343
346
return createStatementForRelationShipWithProperties (
344
347
neo4jPersistentEntity , relationshipContext ,
345
- dynamicRelationshipType , relatedValueEntityHolder
348
+ dynamicRelationshipType , relatedValueEntityHolder , isNewRelationship
346
349
);
347
350
} else {
348
351
return createStatementForRelationshipWithoutProperties (neo4jPersistentEntity , relationshipContext , relatedValue );
349
352
}
350
353
}
351
354
352
355
private CreateRelationshipStatementHolder createStatementForRelationShipWithProperties (Neo4jPersistentEntity <?> neo4jPersistentEntity ,
353
- NestedRelationshipContext relationshipContext , @ Nullable String dynamicRelationshipType , MappingSupport .RelationshipPropertiesWithEntityHolder relatedValue ) {
356
+ NestedRelationshipContext relationshipContext , @ Nullable String dynamicRelationshipType ,
357
+ MappingSupport .RelationshipPropertiesWithEntityHolder relatedValue , boolean isNewRelationship ) {
354
358
355
359
Statement relationshipCreationQuery = CypherGenerator .INSTANCE .prepareSaveOfRelationshipWithProperties (
356
- neo4jPersistentEntity , relationshipContext .getRelationship (), dynamicRelationshipType );
360
+ neo4jPersistentEntity , relationshipContext .getRelationship (), isNewRelationship , dynamicRelationshipType );
361
+
357
362
Map <String , Object > propMap = new HashMap <>();
358
363
// write relationship properties
359
364
getEntityConverter ().write (relatedValue .getRelationshipProperties (), propMap );
0 commit comments