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

Examples of com.orientechnologies.orient.core.metadata.schema.OClass.createIndex()


    oClass.createIndex("sqlSelectIndexReuseTestEmbeddedSetProp8", OClass.INDEX_TYPE.NOTUNIQUE, "fEmbeddedSetTwo", "prop8");
    oClass.createIndex("sqlSelectIndexReuseTestProp9EmbeddedSetProp8", OClass.INDEX_TYPE.NOTUNIQUE, "prop9", "fEmbeddedSetTwo",
        "prop8");

    oClass.createIndex("sqlSelectIndexReuseTestEmbeddedListTwoProp8", OClass.INDEX_TYPE.NOTUNIQUE, "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!",
View Full Code Here


    final OClass superClass = schema.createClass("sqlSelectIndexReuseTestSuperClass");
    superClass.createProperty("prop0", OType.INTEGER);
    final OClass oClass = schema.createClass("sqlSelectIndexReuseTestChildClass", superClass);
    oClass.createProperty("prop1", OType.INTEGER);

    oClass.createIndex("sqlSelectIndexReuseTestOnPropertiesFromClassAndSuperclass", OClass.INDEX_TYPE.UNIQUE, "prop0", "prop1");

    schema.save();

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

    long oldcompositeIndexUsed = profiler.getCounter("db.demo.query.compositeIndexUsed");

    OClass klazz = database.getMetadata().getSchema().getOrCreateClass("CountFunctionWithNotUniqueIndexTest");
    if (!klazz.existsProperty("a")) {
      klazz.createProperty("a", OType.STRING);
      klazz.createIndex("a", "NOTUNIQUE", "a");
    }

    database.newInstance("CountFunctionWithNotUniqueIndexTest").field("a", "a").field("b", "b").save();
    database.newInstance("CountFunctionWithNotUniqueIndexTest").field("a", "a").field("b", "b").save();
    database.newInstance("CountFunctionWithNotUniqueIndexTest").field("a", "a").field("b", "e").save();
View Full Code Here

    long oldcompositeIndexUsed = profiler.getCounter("db.demo.query.compositeIndexUsed");

    OClass klazz = database.getMetadata().getSchema().getOrCreateClass("CountFunctionWithUniqueIndexTest");
    if (!klazz.existsProperty("a")) {
      klazz.createProperty("a", OType.STRING);
      klazz.createIndex("testCountFunctionWithUniqueIndex", "NOTUNIQUE", "a");
    }

    database.newInstance("CountFunctionWithUniqueIndexTest").field("a", "a").field("b", "c").save();
    database.newInstance("CountFunctionWithUniqueIndexTest").field("a", "a").field("b", "c").save();
    database.newInstance("CountFunctionWithUniqueIndexTest").field("a", "a").field("b", "e").save();
View Full Code Here

    personClass.createProperty("birthday", OType.DATE);
    personClass.createProperty("children", OType.INTEGER);

    final OSchema schema = db.getMetadata().getSchema();
    OClass person = schema.getClass("Person");
    person.createIndex("Person.name", INDEX_TYPE.UNIQUE, "name");

    OClass customer = schema.createClass("Customer", person);
    customer.createProperty("totalSold", OType.DECIMAL);

    OClass provider = schema.createClass("Provider", person);
View Full Code Here

    super.beforeClass();

    final OClass byteArrayKeyTest = database.getMetadata().getSchema().createClass("ByteArrayKeyTest");
    byteArrayKeyTest.createProperty("byteArrayKey", OType.BINARY);

    byteArrayKeyTest.createIndex("byteArrayKeyIndex", OClass.INDEX_TYPE.UNIQUE, "byteArrayKey");

    final OClass compositeByteArrayKeyTest = database.getMetadata().getSchema().createClass("CompositeByteArrayKeyTest");
    compositeByteArrayKeyTest.createProperty("byteArrayKey", OType.BINARY);
    compositeByteArrayKeyTest.createProperty("intKey", OType.INTEGER);
View Full Code Here

    final OClass compositeByteArrayKeyTest = database.getMetadata().getSchema().createClass("CompositeByteArrayKeyTest");
    compositeByteArrayKeyTest.createProperty("byteArrayKey", OType.BINARY);
    compositeByteArrayKeyTest.createProperty("intKey", OType.INTEGER);

    compositeByteArrayKeyTest.createIndex("compositeByteArrayKey", OClass.INDEX_TYPE.UNIQUE, "byteArrayKey", "intKey");

    database
        .getMetadata()
        .getIndexManager()
        .createIndex("byte-array-manualIndex-notunique", "NOTUNIQUE", new OSimpleKeyIndexDefinition(OType.BINARY), null, null, null);
View Full Code Here

    final OSchema schema = database.getMetadata().getSchema();
    final OClass clazz = schema.createClass("BetweenConversionTest");
    clazz.createProperty("a", OType.INTEGER);
    clazz.createProperty("ai", OType.INTEGER);

    clazz.createIndex("BetweenConversionTestIndex", OClass.INDEX_TYPE.NOTUNIQUE, "ai");

    for (int i = 0; i < 10; i++) {
      ODocument document = new ODocument("BetweenConversionTest");
      document.field("a", i);
      document.field("ai", i);
View Full Code Here

    personClass.createProperty("birthday", OType.DATE);
    personClass.createProperty("children", OType.INTEGER);

    final OSchema schema = db.getMetadata().getSchema();
    OClass person = schema.getClass("Person");
    person.createIndex("Person.name", INDEX_TYPE.UNIQUE, "name");

    OClass customer = schema.createClass("Customer", person);
    customer.createProperty("totalSold", OType.DECIMAL);

    OClass provider = schema.createClass("Provider", person);
View Full Code Here

  @Test
  public void testGetIndexesWithoutParent() {
    final OClass inClass = database.getMetadata().getSchema().createClass("ClassIndexInTest");
    inClass.createProperty("fOne", OType.INTEGER);

    final OIndex result = inClass.createIndex("ClassIndexInTestPropertyOne", OClass.INDEX_TYPE.UNIQUE, "fOne");

    assertEquals(result.getName(), "ClassIndexInTestPropertyOne");
    assertEquals(inClass.getClassIndex("ClassIndexInTestPropertyOne").getName(), result.getName());

    final Set<OIndex<?>> indexes = inClass.getIndexes();
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.