Hi Luis, this is a simple example, I create two Vertex and one Edge
OrientGraph g=new OrientGraph(path); // create class Person OClass cl=g.createVertexType("Person", "V"); cl.createProperty("name", OType.STRING); cl.createProperty("surname", OType.STRING); // create edge Friend cl=g.createEdgeType("Friend", "E"); // create Person p1 OrientVertex p1=g.addVertex("class:Person"); p1.setProperties("name","Alessandro"); p1.setProperties("surname","Rota"); // create Person p2 OrientVertex p2=g.addVertex("class:Person"); p2.setProperties("name","Federico"); p2.setProperties("surname","Rota"); // create edge p1.addEdge("Friend", p2); g.commit(); Bye, Alessandro Il giorno martedì 26 maggio 2015 23:18:49 UTC+2, Luis A. Burgos ha scritto: > > Hello guys, > > We are currently considering replacing our MySQL backend with a graph > database. The application is huge, and very complex, so we are starting > with a POC. OrientDb is a good candidate, however, I'm having problems > locating meaningful reliable information about how to use OrientDB with > Java. I understand that mixing OODatabase with Graph is not a good idea and > that Graph alone mode provides the best bang for the buck, however, mapping > java classes to vertices and edges is no fun, especially when you have > hundreds of java classes already written. I've read about TinkerPop, > Blueprints and Frames, but can't seem to find a good example to get me > started. > > Can anybody point me in the right direction? Something as simple as > creating a Person class in Java and persisting it int OrientDB using a > Vertex, then creating a second person, then creating an edge, etc? then > retrieving it, etc? > > Any help would be greatly appreciated. > > Thanks, > > Luis > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.