use of com.orientechnologies.orient.core.index.OIndexManager in project orientdb by orientechnologies.
the class IndexManagerTest method testAreIndexedDoesNotContainProperty.
@Test(dependsOnMethods = { "createCompositeIndexTestWithListener", "createCompositeIndexTestWithoutListener", "testCreateOnePropertyIndexTest" })
public void testAreIndexedDoesNotContainProperty() {
final OIndexManager indexManager = database.getMetadata().getIndexManager();
final boolean result = indexManager.areIndexed(CLASS_NAME, Arrays.asList("fSix"));
assertFalse(result);
}
use of com.orientechnologies.orient.core.index.OIndexManager in project orientdb by orientechnologies.
the class IndexManagerTest method testGetClassInvolvedIndexesThreeProperties.
@Test(dependsOnMethods = { "createCompositeIndexTestWithListener", "createCompositeIndexTestWithoutListener", "testCreateOnePropertyIndexTest" })
public void testGetClassInvolvedIndexesThreeProperties() {
final OIndexManager indexManager = database.getMetadata().getIndexManager();
final Set<OIndex<?>> result = indexManager.getClassInvolvedIndexes(CLASS_NAME, Arrays.asList("fTwo", "fOne", "fThree"));
assertEquals(result.size(), 1);
assertEquals(result.iterator().next().getName(), "compositetwo");
}
use of com.orientechnologies.orient.core.index.OIndexManager in project orientdb by orientechnologies.
the class IndexManagerTest method testGetClassInvolvedIndexesOneProperty.
@Test(dependsOnMethods = { "createCompositeIndexTestWithListener", "createCompositeIndexTestWithoutListener", "testCreateOnePropertyIndexTest" })
public void testGetClassInvolvedIndexesOneProperty() {
final OIndexManager indexManager = database.getMetadata().getIndexManager();
final Set<OIndex<?>> result = indexManager.getClassInvolvedIndexes(CLASS_NAME, Arrays.asList("fOne"));
assertEquals(result.size(), 3);
assertTrue(containsIndex(result, "propertyone"));
assertTrue(containsIndex(result, "compositeone"));
assertTrue(containsIndex(result, "compositetwo"));
}
use of com.orientechnologies.orient.core.index.OIndexManager in project orientdb by orientechnologies.
the class IndexManagerTest method testDropNonExistingClassIndex.
@Test(dependsOnMethods = "testDropAllClassIndexes")
public void testDropNonExistingClassIndex() {
final OIndexManager indexManager = database.getMetadata().getIndexManager();
indexManager.dropIndex("twoclassproperty");
}
use of com.orientechnologies.orient.core.index.OIndexManager in project orientdb by orientechnologies.
the class OSchemaShared method dropClassIndexes.
private void dropClassIndexes(final OClass cls) {
final ODatabaseDocument database = getDatabase();
final OIndexManager indexManager = database.getMetadata().getIndexManager();
for (final OIndex<?> index : indexManager.getClassIndexes(cls.getName())) indexManager.dropIndex(index.getName());
}
Aggregations