@@ -179,12 +179,12 @@ public Stream<CommunicationEntity> executeQuery(String cypher, Map<String, Objec
179179 }
180180
181181 @ Override
182- public Stream <CommunicationEntity > traverse (String startNodeId , String relationship , int depth ) {
182+ public Stream <CommunicationEntity > traverse (String startNodeId , String label , int depth ) {
183183 Objects .requireNonNull (startNodeId , "Start node ID is required" );
184- Objects .requireNonNull (relationship , "Relationship type is required" );
184+ Objects .requireNonNull (label , "Relationship type is required" );
185185
186186 String cypher = "MATCH (startNode) WHERE elementId(startNode) = $elementId " +
187- "MATCH (startNode)-[r:" + relationship + "*1.." + depth + "]-(endNode) " +
187+ "MATCH (startNode)-[r:" + label + "*1.." + depth + "]-(endNode) " +
188188 "RETURN endNode" ;
189189
190190 try (Transaction tx = session .beginTransaction ()) {
@@ -198,14 +198,14 @@ public Stream<CommunicationEntity> traverse(String startNodeId, String relations
198198 }
199199
200200 @ Override
201- public void edge (CommunicationEntity source , String relationshipType , CommunicationEntity target ) {
201+ public void edge (CommunicationEntity source , String label , CommunicationEntity target ) {
202202 Objects .requireNonNull (source , "Source entity is required" );
203203 Objects .requireNonNull (target , "Target entity is required" );
204- Objects .requireNonNull (relationshipType , "Relationship type is required" );
204+ Objects .requireNonNull (label , "Relationship type is required" );
205205
206206 String cypher = "MATCH (s) WHERE elementId(s) = $sourceElementId " +
207207 "MATCH (t) WHERE elementId(t) = $targetElementId " +
208- "CREATE (s)-[r:" + relationshipType + "]->(t)" ;
208+ "CREATE (s)-[r:" + label + "]->(t)" ;
209209
210210 try (Transaction tx = session .beginTransaction ()) {
211211 var sourceId = source .find (ID ).orElseThrow (() ->
@@ -224,14 +224,14 @@ public void edge(CommunicationEntity source, String relationshipType, Communicat
224224 }
225225
226226 @ Override
227- public void remove (CommunicationEntity source , String relationshipType , CommunicationEntity target ) {
227+ public void remove (CommunicationEntity source , String label , CommunicationEntity target ) {
228228 Objects .requireNonNull (source , "Source entity is required" );
229229 Objects .requireNonNull (target , "Target entity is required" );
230- Objects .requireNonNull (relationshipType , "Relationship type is required" );
230+ Objects .requireNonNull (label , "Relationship type is required" );
231231
232232 String cypher = "MATCH (s) WHERE elementId(s) = $sourceElementId " +
233233 "MATCH (t) WHERE elementId(t) = $targetElementId " +
234- "MATCH (s)-[r:" + relationshipType + "]-(t) DELETE r" ;
234+ "MATCH (s)-[r:" + label + "]-(t) DELETE r" ;
235235
236236 var sourceId = source .find (ID ).orElseThrow (() ->
237237 new EdgeCommunicationException ("The source entity should have the " + ID + " property" )).get ();
0 commit comments