use of com.tinkerpop.blueprints.impls.orient.OrientVertexType in project orientdb by orientechnologies.
the class GraphValidationTest method testValidationOnVertices.
@Test
public void testValidationOnVertices() {
OrientGraphNoTx g1 = new OrientGraphNoTx(URL, "admin", "admin");
try {
final OrientVertexType validationTestType = g1.createVertexType("ValidationTest");
validationTestType.createEdgeProperty(Direction.OUT, "Connection").setMandatory(true);
validationTestType.createEdgeProperty(Direction.IN, "Connection").setMandatory(true);
final OrientEdgeType connectionType = g1.createEdgeType("Connection");
connectionType.createProperty("in", OType.LINK, validationTestType).setMandatory(true);
connectionType.createProperty("out", OType.LINK, validationTestType).setMandatory(true);
} finally {
g1.shutdown();
}
OrientGraph g2 = new OrientGraph(URL, "admin", "admin");
try {
OrientVertex vertex1 = g2.addTemporaryVertex("ValidationTest");
OrientVertex vertex2 = g2.addTemporaryVertex("ValidationTest");
OrientVertex vertex3 = g2.addTemporaryVertex("ValidationTest");
OrientVertex vertex4 = g2.addTemporaryVertex("ValidationTest");
vertex1.addEdge("Connection", vertex2);
vertex2.addEdge("Connection", vertex3);
vertex3.addEdge("Connection", vertex4);
vertex4.addEdge("Connection", vertex1);
g2.commit();
} finally {
g2.shutdown();
}
}
use of com.tinkerpop.blueprints.impls.orient.OrientVertexType in project orientdb by orientechnologies.
the class BlueprintsConcurrentGraphChangesTestNoTx method initGraph.
private void initGraph() {
OrientBaseGraph graph = getGraph();
graph.setAutoStartTx(false);
graph.commit();
final OrientVertexType vertexType = graph.createVertexType("TestVertex");
vertexType.createProperty("uuid", OType.STRING);
vertexType.createIndex("TestVertexUuidIndex", OClass.INDEX_TYPE.UNIQUE_HASH_INDEX, "uuid");
final OrientEdgeType edgeType = graph.createEdgeType("TestEdge");
edgeType.createProperty("uuid", OType.STRING);
edgeType.createIndex("TestEdgeUuidIndex", OClass.INDEX_TYPE.UNIQUE_HASH_INDEX, "uuid");
graph.shutdown();
}
use of com.tinkerpop.blueprints.impls.orient.OrientVertexType in project orientdb by orientechnologies.
the class LuceneTransactionEmbeddedQueryTest method createSchema.
protected void createSchema(ODatabaseDocumentTx db) {
final OrientVertexType c1 = new OrientGraphNoTx(db).createVertexType("C1");
c1.createProperty("p1", OType.EMBEDDEDLIST, OType.STRING);
c1.createIndex("C1.p1", "FULLTEXT", null, null, "LUCENE", new String[] { "p1" });
}
use of com.tinkerpop.blueprints.impls.orient.OrientVertexType in project orientdb by orientechnologies.
the class LuceneTransactionQueryTest method init.
@Before
public void init() {
final OrientVertexType c1 = new OrientGraphNoTx(db).createVertexType("C1");
c1.createProperty("p1", OType.STRING);
c1.createIndex("C1.p1", "FULLTEXT", null, null, "LUCENE", new String[] { "p1" });
}
use of com.tinkerpop.blueprints.impls.orient.OrientVertexType in project orientdb by orientechnologies.
the class LuceneInheritanceQueryTest method createSchema.
protected void createSchema(ODatabaseDocumentTx db) {
final OrientVertexType c1 = new OrientGraphNoTx(db).createVertexType("C1");
c1.createProperty("name", OType.STRING);
c1.createIndex("C1.name", "FULLTEXT", null, null, "LUCENE", new String[] { "name" });
final OrientVertexType c2 = new OrientGraphNoTx(db).createVertexType("C2");
c2.setSuperClass(c1);
}
Aggregations