use of com.orientechnologies.orient.core.metadata.schema.OProperty in project orientdb by orientechnologies.
the class LocalCreateDocumentMultiThreadIndexedSpeedTest method init.
@Override
public void init() {
database = new ODatabaseDocumentTx(System.getProperty("url"));
database.setProperty("minPool", 2);
database.setProperty("maxPool", 3);
if (database.getURL().startsWith("remote:"))
database.open("admin", "admin");
else {
if (database.exists())
database.drop();
database.create();
}
// database.countClusterElements("Account");
foundObjects = 0;
synchronized (LocalCreateDocumentMultiThreadIndexedSpeedTest.class) {
// database.command(new OCommandSQL("truncate class account")).execute();
OClass c = database.getMetadata().getSchema().getClass("Account");
if (c == null)
c = database.getMetadata().getSchema().createClass("Account");
OProperty p = database.getMetadata().getSchema().getClass("Account").getProperty("id");
if (p == null)
p = database.getMetadata().getSchema().getClass("Account").createProperty("id", OType.INTEGER);
if (!p.isIndexed())
p.createIndex(OClass.INDEX_TYPE.NOTUNIQUE);
}
System.out.println("\nTotal objects in Animal cluster before the test: " + foundObjects);
}
use of com.orientechnologies.orient.core.metadata.schema.OProperty in project orientdb by orientechnologies.
the class CRUDObjectInheritanceTestSchemaFull method checkProperty.
protected void checkProperty(OClass iClass, String iPropertyName, OType iType, OType iLinkedType) {
OProperty prop = iClass.getProperty(iPropertyName);
Assert.assertNotNull(prop);
Assert.assertEquals(prop.getType(), iType);
Assert.assertEquals(prop.getLinkedType(), iLinkedType);
}
Aggregations