java - OrientDB 边缘类继承被忽略

标签 java orientdb

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

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/

相关文章:

java - 如何从按钮的 xml onClick View 中识别 fragment ?

java - Spring MVC 与 AspectJ

java - 无模式 OrientDb 中的关系

nosql - 每个方向具有不同名称的方向关系

java - 打开 OrientDB 数据库时出错

java - 定向数据库:向属性添加属性

Java - 类型转换、泛型、对象和数组

Java:如果 java 库不是线程安全的,这是否意味着我不能在单独的线程中运行它?

java - 解析字符串输出到文件

orientdb - 你如何让 Orientdb 成为独一无二的优势