gpt4 book ai didi

java - OrientDB 边缘类继承被忽略

转载 作者:行者123 更新时间:2023-12-01 13:06:52 25 4
gpt4 key购买 nike

我现在正在解决边缘问题。
我在没有事务的情况下在图中创建了这种边类型:

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com