Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/384.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将fetchplan与Java API结合使用?_Java_Orientdb - Fatal编程技术网

如何将fetchplan与Java API结合使用?

如何将fetchplan与Java API结合使用?,java,orientdb,Java,Orientdb,如上所述,如果我将[*]in_*:-2out_*:-2定义为fetchplan,那么查询应该只返回属性,而不返回关于边的任何信息 OrientGraph graph = new OrientGraph(URL, USER, USER); try { Iterable resultList = graph.command(new OSQLSynchQuery("select from #11:0")).setFetchPlan("[*]in_*:-2 out_*:-

如上所述,如果我将
[*]in_*:-2out_*:-2
定义为fetchplan,那么查询应该只返回属性,而不返回关于边的任何信息

    OrientGraph graph = new OrientGraph(URL, USER, USER);
    try {
        Iterable resultList = graph.command(new OSQLSynchQuery("select from #11:0")).setFetchPlan("[*]in_*:-2 out_*:-2").execute();
        OrientVertex user = (OrientVertex) resultList.iterator().next();
        for (String s : user.getRecord().fieldNames()) {
            System.out.println(s);
        }

        Iterable resultList2 = graph.command(new OSQLSynchQuery("select from #11:0")).execute();
        OrientVertex user2 = (OrientVertex) resultList2.iterator().next();
        for (String s : user2.getRecord().fieldNames()) {
            System.out.println(s);
        }
    } finally {
        graph.shutdown();
    }

我有相同的输出(包括关于边的信息),有和没有fetchplan。我做错了什么?

对于网络协议,获取计划是优化网络传输,而不是排除连接。在上述情况下,如果fetch plan排除,OrientDB客户端将获取连接的边。

Hi@Lvca。是否有一种方法可以在不获取连接边的情况下查看查询获取的内容?仅当启用二进制协议跟踪时:
-Dnetwork.binary.debug=true