2014-04-21 87 views
0

即時工作現在對邊緣問題。
我創建以曲線這個邊緣型無交易: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. 

他爲什麼不走,我作爲superclas創建了edge類型s 的example邊緣?
他爲什麼創建一個新類型作爲E的子類?這裏

this.graph.createVertexType("person", null); 

Vertex vertex = this.graph.addVertex("class:person", null, "person"); 
vertex.setProperty("name", "peter"); 

沒有問題:

我做同樣的事情與頂點,但不同的是它的工作原理。

回答

1

使用邊緣的標籤作爲類:

Edge edge = this.graph.addEdge("class:example", outVertex, inVertex, "example"); 
+1

這是一個低質量的答案。請提供補充說明,否則可能會被刪除。 –

+0

好吧,我明白他的意思(多態)。 – Mulgard