我现在正在解决边缘问题。
我在没有事务的情况下在图中创建了这种边类型:
this.graph.createEdgeType("edge", null);
所以现在有一个边缘类型 edge
及其父级 E
。
当我现在创建已创建边缘类型的边缘时(在带有事务的图中):
Edge edge = this.graph.addEdge("class:edge", outVertex, inVertex, "example");
并向其添加属性:
edge.setProperty("property", "example");
他正在创建一个新类example
作为E
的子类:
WARNING: Committing the active transaction to create the new type 'example'
as subclass of 'E'. The transaction will be reopen right after that.
To avoid this behavior create the classes outside the transaction.
为什么他不采用我作为父类(super class)创建的edge
类型
示例
边缘?
他为什么要创建一个新类型作为 E
的子类?
我对 Vertices 做了同样的事情,但不同的是它有效:
this.graph.createVertexType("person", null);
Vertex vertex = this.graph.addVertex("class:person", null, "person");
vertex.setProperty("name", "peter");
这里没问题。
最佳答案
使用边缘的标签作为类:
Edge edge = this.graph.addEdge("class:example", outVertex, inVertex, "example");
关于java - OrientDB 边缘类继承被忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23196101/