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

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


  @BeforeClass
  public void setupSchema() {
    final OClass linkMapIndexTestClass = database.getMetadata().getSchema().createClass("LinkMapIndexTestClass");
    linkMapIndexTestClass.createProperty("linkMap", OType.LINKMAP);

    linkMapIndexTestClass.createIndex("mapIndexTestKey", OClass.INDEX_TYPE.NOTUNIQUE, "linkMap");
    linkMapIndexTestClass.createIndex("mapIndexTestValue", OClass.INDEX_TYPE.NOTUNIQUE, "linkMap by value");

    database.getMetadata().getSchema().save();
  }
View Full Code Here


  public void setupSchema() {
    final OClass linkMapIndexTestClass = database.getMetadata().getSchema().createClass("LinkMapIndexTestClass");
    linkMapIndexTestClass.createProperty("linkMap", OType.LINKMAP);

    linkMapIndexTestClass.createIndex("mapIndexTestKey", OClass.INDEX_TYPE.NOTUNIQUE, "linkMap");
    linkMapIndexTestClass.createIndex("mapIndexTestValue", OClass.INDEX_TYPE.NOTUNIQUE, "linkMap by value");

    database.getMetadata().getSchema().save();
  }

  @AfterClass
View Full Code Here

    OClass student = database.getMetadata().getSchema().createClass(STUDENT_CLASS_NAME);

    student.createProperty("counter", OType.INTEGER);
    student.createProperty("counter2", OType.INTEGER);

    student.createIndex("index1", OClass.INDEX_TYPE.UNIQUE, "counter");
    student.createIndex("index2", OClass.INDEX_TYPE.NOTUNIQUE, "counter2");
    student.createIndex("index3", OClass.INDEX_TYPE.NOTUNIQUE, "counter", "counter2");

    OClass transactionalStudent = database.getMetadata().getSchema().createClass(TRANSACTIONAL_WORD + STUDENT_CLASS_NAME);
View Full Code Here

    student.createProperty("counter", OType.INTEGER);
    student.createProperty("counter2", OType.INTEGER);

    student.createIndex("index1", OClass.INDEX_TYPE.UNIQUE, "counter");
    student.createIndex("index2", OClass.INDEX_TYPE.NOTUNIQUE, "counter2");
    student.createIndex("index3", OClass.INDEX_TYPE.NOTUNIQUE, "counter", "counter2");

    OClass transactionalStudent = database.getMetadata().getSchema().createClass(TRANSACTIONAL_WORD + STUDENT_CLASS_NAME);

    transactionalStudent.createProperty("counter", OType.INTEGER);
View Full Code Here

    student.createProperty("counter", OType.INTEGER);
    student.createProperty("counter2", OType.INTEGER);

    student.createIndex("index1", OClass.INDEX_TYPE.UNIQUE, "counter");
    student.createIndex("index2", OClass.INDEX_TYPE.NOTUNIQUE, "counter2");
    student.createIndex("index3", OClass.INDEX_TYPE.NOTUNIQUE, "counter", "counter2");

    OClass transactionalStudent = database.getMetadata().getSchema().createClass(TRANSACTIONAL_WORD + STUDENT_CLASS_NAME);

    transactionalStudent.createProperty("counter", OType.INTEGER);
    transactionalStudent.createProperty("counter2", OType.INTEGER);
View Full Code Here

    OClass transactionalStudent = database.getMetadata().getSchema().createClass(TRANSACTIONAL_WORD + STUDENT_CLASS_NAME);

    transactionalStudent.createProperty("counter", OType.INTEGER);
    transactionalStudent.createProperty("counter2", OType.INTEGER);

    transactionalStudent.createIndex("index4", OClass.INDEX_TYPE.UNIQUE, "counter");
    transactionalStudent.createIndex("index5", OClass.INDEX_TYPE.NOTUNIQUE, "counter2");
    transactionalStudent.createIndex("index6", OClass.INDEX_TYPE.NOTUNIQUE, "counter", "counter2");

    database.getMetadata().getSchema().save();
View Full Code Here

    transactionalStudent.createProperty("counter", OType.INTEGER);
    transactionalStudent.createProperty("counter2", OType.INTEGER);

    transactionalStudent.createIndex("index4", OClass.INDEX_TYPE.UNIQUE, "counter");
    transactionalStudent.createIndex("index5", OClass.INDEX_TYPE.NOTUNIQUE, "counter2");
    transactionalStudent.createIndex("index6", OClass.INDEX_TYPE.NOTUNIQUE, "counter", "counter2");

    database.getMetadata().getSchema().save();

    System.out.println("*in before***********CLOSE************************************");
 
View Full Code Here

    transactionalStudent.createProperty("counter", OType.INTEGER);
    transactionalStudent.createProperty("counter2", OType.INTEGER);

    transactionalStudent.createIndex("index4", OClass.INDEX_TYPE.UNIQUE, "counter");
    transactionalStudent.createIndex("index5", OClass.INDEX_TYPE.NOTUNIQUE, "counter2");
    transactionalStudent.createIndex("index6", OClass.INDEX_TYPE.NOTUNIQUE, "counter", "counter2");

    database.getMetadata().getSchema().save();

    System.out.println("*in before***********CLOSE************************************");
    database.close();
View Full Code Here

    String className = "IndexClusterTest";

    OClass oclass = schema.createClass(className);
    oclass.createProperty("key", OType.STRING);
    oclass.createProperty("value", OType.INTEGER);
    oclass.createIndex(className + "index1", OClass.INDEX_TYPE.NOTUNIQUE, "key");

    database.newInstance(className).field("key", "a").field("value", 1).save();

    int clId = database.addCluster(className + "secondCluster");
    oclass.addClusterId(clId);
View Full Code Here

  @Test(dependsOnMethods = { "testCreateUniqueIndex" })
  public void createAdditionalSchemas() {
    final OSchema schema = database.getMetadata().getSchema();
    final OClass oClass = schema.getClass("PropertyIndexTestClass");

    oClass.createIndex("propOne0", OClass.INDEX_TYPE.UNIQUE, "prop0", "prop1");
    oClass.createIndex("propOne1", OClass.INDEX_TYPE.UNIQUE, "prop1", "prop2");
    oClass.createIndex("propOne2", OClass.INDEX_TYPE.UNIQUE, "prop1", "prop3");
    oClass.createIndex("propOne3", OClass.INDEX_TYPE.UNIQUE, "prop2", "prop3");
    oClass.createIndex("propOne4", OClass.INDEX_TYPE.UNIQUE, "prop2", "prop1");
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.