Re: [orientdb] how to manage 1-N relation.

2014-05-20 Thread Stefano Pedroni
Sure: public class benchOrient { public static void main(String[] args) throws UnsupportedEncodingException, NoSuchAlgorithmException, FileNotFoundException{ int n=1000; double alpha=0.7; int maxtab=7; ODatabaseDocumentTx db = new ODatabaseDocumentTx("remote:/localhost/OrientBench").open("admin

Re: [orientdb] how to manage 1-N relation.

2014-05-19 Thread Riccardo Tasso
2014-05-16 14:23 GMT+02:00 Stefano Pedroni : > Suppose that I want to extend this reasoning to a deeper level (e.g. 3 > classes linked together in this way: 0 -> 1 -> 2), I tried with this query > but I don't get any result > Could you share the script to generate your database? This seems to me

Re: [orientdb] how to manage 1-N relation.

2014-05-19 Thread Stefano Pedroni
Is it correct to say that in a RDBMS a query like: SELECT * FROM tab0,tab1,...,tabN WHERE tab0.idTab1 = tab1.idTab1 AND ... AND tabN-1.idTabN = tabN.idTabN AND tabN.integerN = 1 correspond to SELECT * FROM (TRAVERSE * FROM tab0) WHERE integerN = 1 Where each link from class1 to classN is pro

Re: [orientdb] how to manage 1-N relation.

2014-05-19 Thread Stefano Pedroni
up Il giorno venerdì 16 maggio 2014 14:23:21 UTC+2, Stefano Pedroni ha scritto: > > Thank you again, now I'm starting to get the point. > Just another question. > Suppose that I want to extend this reasoning to a deeper level (e.g. 3 > classes linked together in this way: 0 -> 1 -> 2), I tried wi

Re: [orientdb] how to manage 1-N relation.

2014-05-16 Thread Stefano Pedroni
Thank you again, now I'm starting to get the point. Just another question. Suppose that I want to extend this reasoning to a deeper level (e.g. 3 classes linked together in this way: 0 -> 1 -> 2), I tried with this query but I don't get any result select * from tab0 where 1 in linkTab1.linkTab2.

Re: [orientdb] how to manage 1-N relation.

2014-05-16 Thread Riccardo Tasso
2014-05-16 11:51 GMT+02:00 Stefano Pedroni : > I'm trying to simulate a "join", so from "select *" I expect to get the > property of both the class involved (integer0,string0, integer1, string1, > rid of first class, rid of second class).. How can I get all the property > just like the sql join? >

Re: [orientdb] how to manage 1-N relation.

2014-05-16 Thread Stefano Pedroni
Thanks! the problem is that I only get information from the first class (tab0). orientdb {OrientBench}> select * from tab0 where 12 in linkTab1.integer1 +---+++ # |@RID |linkTab1|integer0|string0 +---+---

Re: [orientdb] how to manage 1-N relation.

2014-05-15 Thread Riccardo Tasso
linkTab1.integer1 is a collection, try with: select * from tab0 where 12 in linkTab1.integer1 Cheers, Riccardo 2014-05-15 17:35 GMT+02:00 Stefano Pedroni : > Hi! > I'm trying to work with relations on OrientDb. > I create 2 classes. > The first has a linkset property to the second. > I populate

[orientdb] how to manage 1-N relation.

2014-05-15 Thread Stefano Pedroni
Hi! I'm trying to work with relations on OrientDb. I create 2 classes. The first has a linkset property to the second. I populated those two classes with random numbers, then I linked the documents of the first class (with the same value on "integer*" property) to the documents of the second. Tha