Re: How can i achive Traversing using java

39 views
Skip to first unread message
Message has been deleted

user.w...@gmail.com

unread,
May 26, 2016, 8:31:23 AM5/26/16
to OrientDB
Hello,

in Java you can try this code to launch your query with traverse option:

public class Traverse {

public static void main(String[] args) {
OServerAdmin connection;
try {
connection = new OServerAdmin("remote:db_host/db_name").connect("root", "root");
if (connection.existsDatabase()) {
OrientGraph g = new OrientGraph("remote:db_host/db_name");
Iterable<Vertex> result  = g.command(new OCommandSQL("traverse * from #12:0")).execute();

g.shutdown();
}
}catch (IOException e){
e.printStackTrace();
}
}

}


Il giorno giovedì 26 maggio 2016 14:14:55 UTC+2, eswar reddy ha scritto:

Hi
I have vertex connection that vertex containing multiple edges .
how can I retrieve all in and out  relations. how can I get  above pic  using java code
Message has been deleted

user.w...@gmail.com

unread,
May 26, 2016, 8:37:54 AM5/26/16
to OrientDB
Sure, you can.
Like in standard SQL queries.

Il giorno giovedì 26 maggio 2016 14:36:41 UTC+2, eswar reddy ha scritto:
thank for quic response
can I mention class name vertex rather than using rid?


On Thursday, May 26, 2016 at 5:44:55 PM UTC+5:30, eswar reddy wrote:
Reply all
Reply to author
Forward
0 new messages