Assert.assertTrue(result.isEmpty());
}
public void createInheritanceIndex() {
ODatabaseDocument db = new ODatabaseDocumentTx(database.getURL());
try {
db.open("admin", "admin");
if (!db.getMetadata().getSchema().existsClass("BaseTestClass")) {
OClass baseClass = db.getMetadata().getSchema().createClass("BaseTestClass");
OClass childClass = db.getMetadata().getSchema().createClass("ChildTestClass");
OClass anotherChildClass = db.getMetadata().getSchema().createClass("AnotherChildTestClass");
if (!baseClass.isSuperClassOf(childClass))
childClass.setSuperClass(baseClass);
if (!baseClass.isSuperClassOf(anotherChildClass))
anotherChildClass.setSuperClass(baseClass);
baseClass.createProperty("testParentProperty", OType.LONG).createIndex(OClass.INDEX_TYPE.NOTUNIQUE);
db.getMetadata().getSchema().save();
}
ODocument childClassDocument = db.newInstance("ChildTestClass");
childClassDocument.field("testParentProperty", 10L);
childClassDocument.save();
ODocument anotherChildClassDocument = db.newInstance("AnotherChildTestClass");
anotherChildClassDocument.field("testParentProperty", 11L);
anotherChildClassDocument.save();
Assert.assertFalse(new ORecordId(-1, ORID.CLUSTER_POS_INVALID).equals(childClassDocument.getIdentity()));
Assert.assertFalse(new ORecordId(-1, ORID.CLUSTER_POS_INVALID).equals(anotherChildClassDocument.getIdentity()));
} finally {
db.close();
}
}