Skip to content

RemoteVertex.newEdge does not support Map properties, while GraphEntity.newEdge does #1569

Description

@rmsloan

ArcadeDB Version:

ArcadeDB Server v24.4.1

OS and JDK Version:

Running on Linux 4.18.0-477.21.1.el8_8.x86_64 - OpenJDK 64-Bit Server VM 11.0.22 (Temurin-11.0.22+7)

Expected behavior

`Expected all implementations of Vertex.newEdge(..., final Object... properties) to support both

  • Map
  • or
  • array or sequence of arguments
    for properties. `

Actual behavior

Success case (embedded):

GraphEngine.newEdge(...) employs its setProperties method which handles properties provided to it as a Map OR array of arguments (Properties must be an even number as pairs of name, value).

Failure case (remote):

RemoteVertex.newEdge(...) expects only an array of arguments.
Properties provided as a Map results in an Exception at line 143.
class java.util.HashMap cannot be cast to class java.lang.String (java.util.HashMap and java.lang.String)

Steps to reproduce

db is a RemoteDatabase

  db.transaction( () -> {
    MutableVertex elon = db.newVertex("User", "name", "Elon", "lastName", "Musk").save();
    MutableVertex steve = db.newVertex("User", "name", "Steve", "lastName", "Jobs").save();
    Map<String, Object> properties = new HashMap();
    properties.put("since", 2010);
    properties.put("Map", "would like to be supported in RemoteVertex, just like it's buddy GraphEngine ;-)");
    elon.newEdge("IsFriendOf", steve, true, properties);
  });

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions