0
正如here所述,如果我將[*]in_*:-2 out_*:-2
定義爲fetchplan,那麼查詢應該只返回屬性而沒有關於邊的信息。如何在Java API中使用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。我究竟做錯了什麼?
Hi @Lvca。有沒有一種方法可以查看查詢所提取的內容,而無需獲取連接的邊? – vitorenesduarte 2015-04-02 08:02:53
僅當您啓用二進制協議的跟蹤時:'-Dnetwork.binary.debug = true' – Lvca 2015-04-06 18:17:25