带有字母数字标签的边缘

时间:2015-12-03 00:27:37

标签: orientdb

我使用的是os x 10.6.8,java 6和orient 2.0.12。执行此代码后,我注意到以下行为:

package orientdb;

import java.io.File;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.impls.orient.OrientGraph;

public class testEdge {

    public static void main(String[] args){
        try{
            File f = new File(System.getProperty("user.home") + File.separator + "edgeTest");
            if (f.exists())
                f.delete();
            f.mkdirs();
            OrientGraph g = new OrientGraph("plocal:" + f.getAbsolutePath());

            g.begin();
            Vertex v = g.addVertex(null);
            Vertex v1 = g.addVertex(null);
            Edge e = v.addEdge("2k", v1);
            g.commit();
            g.shutdown();
        }
        catch(Exception x){
            x.printStackTrace();
        }
    }
}

我打开工作室并执行"从e"中选择。反映的边缘标签是" -2k"而不是" 2k"。如果标签不包含数字,则不会发生。

这是约束吗?

非常感谢!

1 个答案:

答案 0 :(得分:0)

是的,确实如此。 Edge的标签是一个OrientDB类,它扩展了E(Edges的基类)。

相关问题