[orientdb] Bug with local cache?

2015-12-02 Thread Johan Sjöberg
Consider the following. A class called "Brand" which contains one vertex: { @rid = #11:0 name = "BMW" } A class called "Type" which contains two vertices: { @rid = #10:0 name = "SUV" } { @rid = #10:1 name = "Sedan" } I have two edges of the same edgeclass, TypeToBrand: { @rid = #12:0 out =

Re: [orientdb] proper way to add extra information to documents (ODocument), Java API, oDB 2.1.2

2015-12-02 Thread Luigi Dell'Aquila
Hi Mihai, you have two solutions: 1. use fetchplan: doc.toJson("fetchPlan:*:3") 2, use UNWIND: select *, items.* from (select *, out('E_SomeEdge') as items from ? UNWIND items) Luigi 2015-12-02 10:58 GMT+01:00 Mihai Ocneanu : > Hello, > > I have a vertex with some

[orientdb] proper way to add extra information to documents (ODocument), Java API, oDB 2.1.2

2015-12-02 Thread Mihai Ocneanu
Hello, I have a vertex with some attributes and some edges, and I need to retrive it back as JSON, with the extra requirement that I also want to expand some edges. Code is something like this: OSQLSynchQuery query = new OSQLSynchQuery<>("select from ? "); List result =

[orientdb] Re: proper way to add extra information to documents (ODocument), Java API, oDB 2.1.2

2015-12-02 Thread Mihai Ocneanu
> > Hi Mihai, > > you have two solutions: > 1. use fetchplan: doc.toJson("fetchPlan:*:3") > > 2, use UNWIND: > > select *, items.* from (select *, out('E_SomeEdge') as items from ? > UNWIND items) > > Luigi Thanks for the ideas, Luigi. First method works perfectly and it does what I was

Re: [orientdb] Re: proper way to add extra information to documents (ODocument), Java API, oDB 2.1.2

2015-12-02 Thread Luigi Dell'Aquila
Hi Mihai, exactly, the two methods are not equivalent in how they return results. In case 2 you can repliace the prefix with a custom one, using AS Thanks Luigi 2015-12-02 12:49 GMT+01:00 Mihai Ocneanu : > Hi Mihai, >> >> you have two solutions: >> 1. use fetchplan: