@@ -179,12 +179,12 @@ public Stream<CommunicationEntity> executeQuery(String cypher, Map<String, Objec
179
179
}
180
180
181
181
@ Override
182
- public Stream <CommunicationEntity > traverse (String startNodeId , String relationship , int depth ) {
182
+ public Stream <CommunicationEntity > traverse (String startNodeId , String label , int depth ) {
183
183
Objects .requireNonNull (startNodeId , "Start node ID is required" );
184
- Objects .requireNonNull (relationship , "Relationship type is required" );
184
+ Objects .requireNonNull (label , "Relationship type is required" );
185
185
186
186
String cypher = "MATCH (startNode) WHERE elementId(startNode) = $elementId " +
187
- "MATCH (startNode)-[r:" + relationship + "*1.." + depth + "]-(endNode) " +
187
+ "MATCH (startNode)-[r:" + label + "*1.." + depth + "]-(endNode) " +
188
188
"RETURN endNode" ;
189
189
190
190
try (Transaction tx = session .beginTransaction ()) {
@@ -198,14 +198,14 @@ public Stream<CommunicationEntity> traverse(String startNodeId, String relations
198
198
}
199
199
200
200
@ Override
201
- public void edge (CommunicationEntity source , String relationshipType , CommunicationEntity target ) {
201
+ public void edge (CommunicationEntity source , String label , CommunicationEntity target ) {
202
202
Objects .requireNonNull (source , "Source entity is required" );
203
203
Objects .requireNonNull (target , "Target entity is required" );
204
- Objects .requireNonNull (relationshipType , "Relationship type is required" );
204
+ Objects .requireNonNull (label , "Relationship type is required" );
205
205
206
206
String cypher = "MATCH (s) WHERE elementId(s) = $sourceElementId " +
207
207
"MATCH (t) WHERE elementId(t) = $targetElementId " +
208
- "CREATE (s)-[r:" + relationshipType + "]->(t)" ;
208
+ "CREATE (s)-[r:" + label + "]->(t)" ;
209
209
210
210
try (Transaction tx = session .beginTransaction ()) {
211
211
var sourceId = source .find (ID ).orElseThrow (() ->
@@ -224,14 +224,14 @@ public void edge(CommunicationEntity source, String relationshipType, Communicat
224
224
}
225
225
226
226
@ Override
227
- public void remove (CommunicationEntity source , String relationshipType , CommunicationEntity target ) {
227
+ public void remove (CommunicationEntity source , String label , CommunicationEntity target ) {
228
228
Objects .requireNonNull (source , "Source entity is required" );
229
229
Objects .requireNonNull (target , "Target entity is required" );
230
- Objects .requireNonNull (relationshipType , "Relationship type is required" );
230
+ Objects .requireNonNull (label , "Relationship type is required" );
231
231
232
232
String cypher = "MATCH (s) WHERE elementId(s) = $sourceElementId " +
233
233
"MATCH (t) WHERE elementId(t) = $targetElementId " +
234
- "MATCH (s)-[r:" + relationshipType + "]-(t) DELETE r" ;
234
+ "MATCH (s)-[r:" + label + "]-(t) DELETE r" ;
235
235
236
236
var sourceId = source .find (ID ).orElseThrow (() ->
237
237
new EdgeCommunicationException ("The source entity should have the " + ID + " property" )).get ();
0 commit comments