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

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


    clazz.createProperty("prop3", OType.INTEGER);

    final ODocument metadata = new ODocument();
    metadata.field("ignoreNullValues", false);

    clazz.createIndex("compositeIndexNullRangeQueryIndex", OClass.INDEX_TYPE.NOTUNIQUE.toString(), null, metadata, null,
        new String[] { "prop1", "prop2", "prop3" });

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


    clazz.createProperty("prop3", OType.INTEGER);

    final ODocument metadata = new ODocument();
    metadata.field("ignoreNullValues", false);

    clazz.createIndex("compositeIndexNullRangeQueryInMiddleTxIndex", OClass.INDEX_TYPE.NOTUNIQUE.toString(), null, metadata, null,
        new String[] { "prop1", "prop2", "prop3" });

    database.begin();
    for (int i = 0; i < 20; i++) {
      ODocument document = new ODocument("compositeIndexNullRangeQueryInMiddleTxClass");
View Full Code Here

    clazz.createProperty("prop3", OType.INTEGER);

    final ODocument metadata = new ODocument();
    metadata.field("ignoreNullValues", false);

    clazz.createIndex("compositeIndexNullPointQueryNullInTheMiddleIndex", OClass.INDEX_TYPE.NOTUNIQUE.toString(), null, metadata,
        null, new String[] { "prop1", "prop2", "prop3" });

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

    clazz.createProperty("prop3", OType.INTEGER);

    final ODocument metadata = new ODocument();
    metadata.field("ignoreNullValues", false);

    clazz.createIndex("compositeIndexNullPointQueryNullInTheMiddleInMiddleTxIndex", OClass.INDEX_TYPE.NOTUNIQUE.toString(), null,
        metadata, null, new String[] { "prop1", "prop2", "prop3" });

    database.begin();

    for (int i = 0; i < 20; i++) {
View Full Code Here

    clazz.createProperty("prop3", OType.INTEGER);

    final ODocument metadata = new ODocument();
    metadata.field("ignoreNullValues", false);

    clazz.createIndex("compositeIndexNullRangeQueryNullInTheMiddleIndex", OClass.INDEX_TYPE.NOTUNIQUE.toString(), null, metadata,
        new String[] { "prop1", "prop2", "prop3" });

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

    clazz.createProperty("prop3", OType.INTEGER);

    final ODocument metadata = new ODocument();
    metadata.field("ignoreNullValues", false);

    clazz.createIndex("compositeIndexNullRangeQueryNullInTheMiddleInMiddleTxIndex", OClass.INDEX_TYPE.NOTUNIQUE.toString(), null,
        metadata, new String[] { "prop1", "prop2", "prop3" });

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

    final OSchema schema = database.getMetadata().getSchema();
    if (!schema.existsClass("lpirtStudent")) {
      final OClass curatorClass = schema.createClass("lpirtCurator");
      curatorClass.createProperty("name", OType.STRING).createIndex(OClass.INDEX_TYPE.NOTUNIQUE);
      curatorClass.createProperty("salary", OType.INTEGER).createIndex(OClass.INDEX_TYPE.UNIQUE);
      curatorClass.createIndex("curotorCompositeIndex", OClass.INDEX_TYPE.UNIQUE, "salary", "name");

      final OClass groupClass = schema.createClass("lpirtGroup");
      groupClass.createProperty("name", OType.STRING).createIndex(OClass.INDEX_TYPE.UNIQUE);
      groupClass.createProperty("curator", OType.LINK, curatorClass).createIndex(OClass.INDEX_TYPE.UNIQUE);
View Full Code Here

      final OClass diplomaClass = schema.createClass("lpirtDiploma");
      diplomaClass.createProperty("GPA", OType.DOUBLE).createIndex(OClass.INDEX_TYPE.NOTUNIQUE);
      diplomaClass.createProperty("thesis", OType.STRING).createIndex(OClass.INDEX_TYPE.FULLTEXT);
      diplomaClass.createProperty("name", OType.STRING).createIndex(OClass.INDEX_TYPE.UNIQUE);
      diplomaClass.createIndex("diplomaThesisUnique", OClass.INDEX_TYPE.UNIQUE, "thesis");

      final OClass transcriptClass = schema.createClass("lpirtTranscript");
      transcriptClass.createProperty("id", OType.STRING).createIndex(OClass.INDEX_TYPE.UNIQUE_HASH_INDEX);

      final OClass skillClass = schema.createClass("lpirtSkill");
View Full Code Here

      studentClass.createProperty("diploma", OType.LINK, diplomaClass);
      studentClass.createProperty("transcript", OType.LINK, transcriptClass).createIndex(OClass.INDEX_TYPE.UNIQUE_HASH_INDEX);
      studentClass.createProperty("skill", OType.LINK, skillClass);

      final ODocument metadata = new ODocument().field("ignoreNullValues", false);
      studentClass.createIndex("studentDiplomaAndNameIndex", OClass.INDEX_TYPE.UNIQUE.toString(), null, metadata.copy(),
          new String[] { "diploma", "name" });
      studentClass.createIndex("studentSkillAndGroupIndex", OClass.INDEX_TYPE.NOTUNIQUE_HASH_INDEX.toString(), null,
          metadata.copy(), new String[] { "skill", "group" });

      schema.save();
View Full Code Here

      studentClass.createProperty("skill", OType.LINK, skillClass);

      final ODocument metadata = new ODocument().field("ignoreNullValues", false);
      studentClass.createIndex("studentDiplomaAndNameIndex", OClass.INDEX_TYPE.UNIQUE.toString(), null, metadata.copy(),
          new String[] { "diploma", "name" });
      studentClass.createIndex("studentSkillAndGroupIndex", OClass.INDEX_TYPE.NOTUNIQUE_HASH_INDEX.toString(), null,
          metadata.copy(), new String[] { "skill", "group" });

      schema.save();
    }
  }
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.