Package com.orientechnologies.orient.core.metadata.schema

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema.save()


    final OClass superTest = schema.createClass("SchemaSharedIndexSuperTest");
    final OClass test = schema.createClass("SchemaIndexTest", superTest);
    test.createProperty("prop1", OType.DOUBLE);
    test.createProperty("prop2", OType.DOUBLE);

    schema.save();
  }

  @AfterMethod
  public void tearDown() throws Exception {
    database.command(new OCommandSQL("drop class SchemaIndexTest")).execute();
View Full Code Here


    final OSchema schema = database.getMetadata().getSchema();
    final OClass oClass = schema.createClass("SQLDropIndexTestClass");
    oClass.createProperty("prop1", EXPECTED_PROP1_TYPE);
    oClass.createProperty("prop2", EXPECTED_PROP2_TYPE);

    schema.save();
  }

  @AfterClass
  public void afterClass() throws Exception {
    if (database.isClosed())
View Full Code Here

    oClass.createProperty("prop1", OType.INTEGER);

    oClass.createIndex("sqlSelectHashIndexReuseTestOnPropertiesFromClassAndSuperclass", OClass.INDEX_TYPE.UNIQUE_HASH_INDEX,
        "prop0", "prop1");

    schema.save();

    long oldIndexUsage = profiler.getCounter("db.demo.query.indexUsed");
    long oldcompositeIndexUsed = profiler.getCounter("db.demo.query.compositeIndexUsed");
    long oldcompositeIndexUsed2 = profiler.getCounter("db.demo.query.compositeIndexUsed.2");
View Full Code Here

        "fEmbeddedSetTwo", "prop8");

    oClass.createIndex("sqlSelectHashIndexReuseTestEmbeddedListTwoProp8", OClass.INDEX_TYPE.NOTUNIQUE_HASH_INDEX,
        "fEmbeddedListTwo", "prop8");

    schema.save();

    final String fullTextIndexStrings[] = { "Alice : What is the use of a book, without pictures or conversations?",
        "Rabbit : Oh my ears and whiskers, how late it's getting!",
        "Alice : If it had grown up, it would have made a dreadfully ugly child; but it makes rather a handsome pig, I think",
        "The Cat : We're all mad here.", "The Hatter : Why is a raven like a writing desk?",
View Full Code Here

    final OSchema schema = database.getMetadata().getSchema();
    final OClass oClass = schema.createClass("SQLDropClassTestClass");
    oClass.createProperty("prop1", EXPECTED_PROP1_TYPE);
    oClass.createProperty("prop2", EXPECTED_PROP2_TYPE);

    schema.save();
    database.close();
  }

  @BeforeMethod
  public void beforeMethod() {
View Full Code Here

    if (database.isClosed())
      database.open("admin", "admin");

    final OSchema schema = database.getMetadata().getSchema();
    schema.createClass(TEST_CLASS);
    schema.save();

    database.close();
  }

  @AfterClass
View Full Code Here

    final OSchema schema = database.getMetadata().getSchema();

    final OClass testClass = schema.createClass("SQLSelectCompositeIndexDirectSearchTestClass");
    testClass.createProperty("prop1", OType.INTEGER);
    testClass.createProperty("prop2", OType.INTEGER);
    schema.save();

    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < 10; j++) {
        final ODocument document = new ODocument("SQLSelectCompositeIndexDirectSearchTestClass");
        document.field("prop1", i);
View Full Code Here

    OSchema schema = database.getMetadata().getSchema();
    OClass testClass = getOrCreateClass(schema);

    final OIndex<?> index = getOrCreateIndex(testClass);
    schema.save();

    database.command(new OCommandSQL("truncate class test_class")).execute();

    database.save(new ODocument(testClass).field("name", "x").field("data", Arrays.asList(1, 2)));
    database.save(new ODocument(testClass).field("name", "y").field("data", Arrays.asList(3, 0)));
View Full Code Here

      OSchema schema = db.getMetadata().getSchema();
      if (!schema.existsClass(CLASSNAME)) {
        OClass oc = schema.createClass(CLASSNAME);
        oc.createProperty(PROPKEY, OType.STRING);
        oc.setStrictMode(true);
        schema.save();
      }
    } finally {
      db.close();
    }
View Full Code Here

    Assert.assertEquals(indexDefinition.getFields().size(), 1);
    Assert.assertTrue(indexDefinition.getFields().contains("prop1"));
    Assert.assertEquals(indexDefinition.getTypes().length, 1);
    Assert.assertEquals(indexDefinition.getTypes()[0], OType.STRING);

    schema.save();
  }

  @Test(dependsOnMethods = { "testCreateUniqueIndex" })
  public void createAdditionalSchemas() {
    final OSchema schema = database.getMetadata().getSchema();
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.