Hi, I have used this code
OrientGraphFactory factory = new OrientGraphFactory(currentPath);
OrientGraphNoTx g1=factory.getNoTx();
// creating class Person
OClass person=g1.createVertexType("Person", "V");
person.createProperty("name", OType.STRING);
person.createProperty("surname", OType.STRING);
// creating class Department
OClass department=g1.createVertexType("Department", "V");
department.createProperty("name", OType.STRING);
// creating class work
OClass edge_work=g1.createEdgeType("work", "E");
g1.shutdown();
OrientGraph g2=factory.getTx();
OrientVertex person1=g2.addVertex("class:Department");
person1.setProperty("name","Alessandro");
person1.setProperty("surname","Rota");
Vertex dep1=g2.addVertex("class:Department");
dep1.setProperty("name","Department 1");
person1.addEdge("work", dep1);
g2.commit();
FROM STUDIO
<https://lh3.googleusercontent.com/-v19NeC4s5bw/Vs8Dqt59XQI/AAAAAAAAAKU/ycimP-tqQ5I/s1600/e1.png>
<https://lh3.googleusercontent.com/-OJ3a0QCzwdo/Vs8D1nb751I/AAAAAAAAAKY/8eCKSFwSOLg/s1600/e2.png>
Kind regards,
Alessandro
--
---
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 [email protected].
For more options, visit https://groups.google.com/d/optout.