有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

Java如何在Arangodb上创建边?

我使用java创建了一个边缘集合,但当我尝试创建一个文档时,在方法(insertEdge)上出现了一个错误

有人知道做这件事的其他方法吗,或者我可能做错了什么

BaseEdgeDocument myObject = new BaseEdgeDocument("TurmaA/asd","TurmaA/testepedro");
myObject.addAttribute(nome.getField(), nome.getValue());
collection.insertEdge(myObject, new EdgeCreateOptions());

PS-给出的错误是“找不到符号(方法)”

Image of the problem


共 (1) 个答案

  1. # 1 楼答案

    当阅读关于cannot find symbol的内容时,您试图调用insertEdge方法的对象(collection)可能不是edge collection类型,因此它没有insertEdge-method

    example code shows how to work with edge collections

    private static EdgeEntity saveEdge(final CircleEdge edge) throws ArangoDBException {
            return db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME).insertEdge(edge);
    }