简体   繁体   中英

ArangoDB Java Driver edges without annotations

The current driver implementation uses annotations to determine the source/from and target/to of an edge (as other information). From the Java driver examples:

public class CircleEdge {

  @DocumentField(Type.ID)
  private String id;

  @DocumentField(Type.KEY)
  private String key;

  @DocumentField(Type.REV)
  private String revision;

  @DocumentField(Type.FROM)
  private String from;

  @DocumentField(Type.TO)
  private String to;
  ...

Thus, when one adds the edge to the graph only an instance of this class is needed. If one wishes to store arbitrary objects or objects of classes which can not be modified to add the annotations, what is the way to do this? After quick look in the driver implementation I could not find a method in the form of:

graph.addEdge(obj, from, to)

Any pointers are welcome.

The expected behavior is that one implements classes which are representing the persisted entities and so are able to modify them.

But still - I think - your case is valid and such a convenience method should exists. I will discuss this with my colleagues from ArangoDB. To track the progress on this, I created an github issue .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM