Examples of OIndexManager


Examples of com.orientechnologies.orient.core.index.OIndexManager

    schemaClusterId = database.getClusterIdByName(OStorage.CLUSTER_INTERNAL_NAME);

    indexManager = new OIndexManagerProxy(database.getStorage().getResource(OIndexManager.class.getSimpleName(),
        new Callable<OIndexManager>() {
          public OIndexManager call() {
            OIndexManager instance;
            if (database.getStorage() instanceof OStorageEmbedded)
              instance = new OIndexManagerShared(database);
            else
              instance = new OIndexManagerRemote(database);

            if (iLoad)
              instance.load();

            return instance;
          }
        }), database);

    schema = new OSchemaProxy(database.getStorage().getResource(OSchema.class.getSimpleName(), new Callable<OSchemaShared>() {
      public OSchemaShared call() {
        final OSchemaShared instance = new OSchemaShared(schemaClusterId);
        if (iLoad)
          instance.load();
        return instance;
      }
    }), database);

    Boolean enableSecurity = (Boolean) database.getProperty(ODatabase.OPTIONS.SECURITY.toString());
    if (enableSecurity != null && !enableSecurity)
      // INSTALL NO SECURITY IMPL
      security = new OSecurityNull();
    else
      security = new OSecurityProxy(database.getStorage().getResource(OSecurity.class.getSimpleName(),
          new Callable<OSecurityShared>() {
            public OSecurityShared call() {
              final OSecurityShared instance = new OSecurityShared();
              if (iLoad)
                instance.load();
              return instance;
            }
          }), database);

  }
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManager

    schemaClusterId = database.getClusterIdByName(OStorage.CLUSTER_INTERNAL_NAME);

    indexManager = new OIndexManagerProxy(database.getStorage().getResource(OIndexManager.class.getSimpleName(),
        new Callable<OIndexManager>() {
          public OIndexManager call() {
            OIndexManager instance;
            if (database.getStorage() instanceof OStorageEmbedded)
              instance = new OIndexManagerShared(database);
            else
              instance = new OIndexManagerRemote(database);

            if (iLoad)
              instance.load();

            return instance;
          }
        }), database);

    schema = new OSchemaProxy(database.getStorage().getResource(OSchema.class.getSimpleName(), new Callable<OSchemaShared>() {
      public OSchemaShared call() {
        final OSchemaShared instance = new OSchemaShared(schemaClusterId);
        if (iLoad)
          instance.load();
        return instance;
      }
    }), database);

    Boolean enableSecurity = (Boolean) database.getProperty(ODatabase.OPTIONS.SECURITY.toString());
    if (enableSecurity != null && !enableSecurity)
      // INSTALL NO SECURITY IMPL
      security = new OSecurityNull();
    else
      security = new OSecurityProxy(database.getStorage().getResource(OSecurity.class.getSimpleName(),
          new Callable<OSecurityShared>() {
            public OSecurityShared call() {
              final OSecurityShared instance = new OSecurityShared();
              if (iLoad)
                instance.load();
              return instance;
            }
          }), database);

  }
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManager

  private void init() {
    schemaClusterId = database.getClusterIdByName(OStorage.CLUSTER_INTERNAL_NAME);

    schema = new OSchema(database, schemaClusterId);
    security = new OSecurity(database);
    indexManager = new OIndexManager(database);
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManager

  }

  @Test(dependsOnMethods = { "createCompositeIndexTestWithListener", "createCompositeIndexTestWithoutListener",
      "testCreateOnePropertyIndexTest" })
  public void testGetClassIndexesBrokenClassNameCase() {
    final OIndexManager indexManager = database.getMetadata().getIndexManager();

    final Set<OIndex<?>> indexes = indexManager.getClassIndexes("ClassforindeXMaNAgerTeST");
    final Set<OIndexDefinition> expectedIndexDefinitions = new HashSet<OIndexDefinition>();

    final OCompositeIndexDefinition compositeIndexOne = new OCompositeIndexDefinition(CLASS_NAME);

    compositeIndexOne.addIndex(new OPropertyIndexDefinition(CLASS_NAME, "fOne", OType.INTEGER));
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManager

  }

  @Test
  public void testDropIndex() throws Exception {
    final OIndexManager indexManager = database.getMetadata().getIndexManager();

    indexManager.createIndex("anotherproperty", OClass.INDEX_TYPE.UNIQUE.toString(), new OPropertyIndexDefinition(CLASS_NAME,
        "fOne", OType.INTEGER), new int[] { database.getClusterIdByName(CLASS_NAME) }, null, null);

    assertNotNull(indexManager.getIndex("anotherproperty"));
    assertNotNull(indexManager.getClassIndex(CLASS_NAME, "anotherproperty"));

    indexManager.dropIndex("anotherproperty");

    assertNull(indexManager.getIndex("anotherproperty"));
    assertNull(indexManager.getClassIndex(CLASS_NAME, "anotherproperty"));
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManager

    assertNull(indexManager.getClassIndex(CLASS_NAME, "anotherproperty"));
  }

  @Test
  public void testDropSimpleKey() {
    final OIndexManager indexManager = database.getMetadata().getIndexManager();
    indexManager.createIndex("simplekeytwo", OClass.INDEX_TYPE.UNIQUE.toString(), new OSimpleKeyIndexDefinition(OType.INTEGER),
        null, null, null);

    assertNotNull(indexManager.getIndex("simplekeytwo"));

    indexManager.dropIndex("simplekeytwo");

    assertNull(indexManager.getIndex("simplekeytwo"));
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManager

    assertNull(indexManager.getIndex("simplekeytwo"));
  }

  @Test
  public void testDropNullKeyDefinition() {
    final OIndexManager indexManager = database.getMetadata().getIndexManager();

    indexManager.createIndex("nullkeytwo", OClass.INDEX_TYPE.UNIQUE.toString(), null, null, null, null);

    assertNotNull(indexManager.getIndex("nullkeytwo"));

    indexManager.dropIndex("nullkeytwo");

    assertNull(indexManager.getIndex("nullkeytwo"));
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManager

  @Test
  public void testDropAllClassIndexes() {
    final OClass oClass = database.getMetadata().getSchema().createClass("indexManagerTestClassTwo");
    oClass.createProperty("fOne", OType.INTEGER);

    final OIndexManager indexManager = database.getMetadata().getIndexManager();

    indexManager.createIndex("twoclassproperty", OClass.INDEX_TYPE.UNIQUE.toString(), new OPropertyIndexDefinition(
        "indexManagerTestClassTwo", "fOne", OType.INTEGER), new int[] { database.getClusterIdByName("indexManagerTestClassTwo") },
        null, null);

    assertFalse(indexManager.getClassIndexes("indexManagerTestClassTwo").isEmpty());

    indexManager.dropIndex("twoclassproperty");

    assertTrue(indexManager.getClassIndexes("indexManagerTestClassTwo").isEmpty());
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManager

    assertTrue(indexManager.getClassIndexes("indexManagerTestClassTwo").isEmpty());
  }

  @Test(dependsOnMethods = "testDropAllClassIndexes")
  public void testDropNonExistingClassIndex() {
    final OIndexManager indexManager = database.getMetadata().getIndexManager();

    indexManager.dropIndex("twoclassproperty");
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OIndexManager

  }

  @Test(dependsOnMethods = { "createCompositeIndexTestWithListener", "createCompositeIndexTestWithoutListener",
      "testCreateOnePropertyIndexTest" })
  public void testGetClassIndex() {
    final OIndexManager indexManager = database.getMetadata().getIndexManager();

    final OIndex<?> result = indexManager.getClassIndex(CLASS_NAME, "propertyone");
    assertNotNull(result);
    assertEquals(result.getName(), "propertyone");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.