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

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


  public void setupSchema() {
    final OClass ridBagIndexTestClass = database.getMetadata().getSchema().createClass("RidBagIndexTestClass");

    ridBagIndexTestClass.createProperty("ridBag", OType.LINKBAG);

    ridBagIndexTestClass.createIndex("ridBagIndex", OClass.INDEX_TYPE.NOTUNIQUE, "ridBag");

    database.close();
  }

  @AfterClass
View Full Code Here


      db.create();
    }

    final OClass indexedClass = db.getMetadata().getSchema().createClass("IndexedClass");
    indexedClass.createProperty("value", OType.STRING);
    indexedClass.createIndex("indexValue", OClass.INDEX_TYPE.UNIQUE, "value");

    final ODocument document = new ODocument("IndexedClass");
    document.field("value", "value");
    document.save();
View Full Code Here

      type.createProperty(P_SOURCEID_NAME, OType.STRING).setNotNull(true);
      type.createProperty(P_SOURCEID_ID, OType.STRING).setNotNull(true);
      type.createProperty(P_FACTORYNAME, OType.STRING).setNotNull(true);
      type.createProperty(P_CONFIGURATION, OType.EMBEDDEDMAP);

      type.createIndex(DB_CLASS + "_" + P_SOURCEID_NAME + "idx", INDEX_TYPE.UNIQUE, P_SOURCEID_NAME);
      type.createIndex(DB_CLASS + "_" + P_SOURCEID_ID + "idx", INDEX_TYPE.UNIQUE, P_SOURCEID_ID);

      log.info("Created schema: {}, properties: {}", type, type.properties());
    }
    return type;
View Full Code Here

      type.createProperty(P_SOURCEID_ID, OType.STRING).setNotNull(true);
      type.createProperty(P_FACTORYNAME, OType.STRING).setNotNull(true);
      type.createProperty(P_CONFIGURATION, OType.EMBEDDEDMAP);

      type.createIndex(DB_CLASS + "_" + P_SOURCEID_NAME + "idx", INDEX_TYPE.UNIQUE, P_SOURCEID_NAME);
      type.createIndex(DB_CLASS + "_" + P_SOURCEID_ID + "idx", INDEX_TYPE.UNIQUE, P_SOURCEID_ID);

      log.info("Created schema: {}, properties: {}", type, type.properties());
    }
    return type;
  }
View Full Code Here

      type.createProperty(P_VIEWNAME, OType.STRING).setNotNull(true);
      type.createProperty(P_VIEWID, OType.STRING).setNotNull(true);
      type.createProperty(P_FACTORYNAME, OType.STRING).setNotNull(true);
      type.createProperty(P_CONFIGURATION, OType.EMBEDDEDMAP);

      type.createIndex(DB_CLASS + "_" + P_VIEWNAME + "idx", INDEX_TYPE.UNIQUE, P_VIEWNAME);
      type.createIndex(DB_CLASS + "_" + P_VIEWID + "idx", INDEX_TYPE.UNIQUE, P_VIEWID);
      log.info("Created schema: {}, properties: {}", type, type.properties());
    }
    return type;
  }
View Full Code Here

      type.createProperty(P_VIEWID, OType.STRING).setNotNull(true);
      type.createProperty(P_FACTORYNAME, OType.STRING).setNotNull(true);
      type.createProperty(P_CONFIGURATION, OType.EMBEDDEDMAP);

      type.createIndex(DB_CLASS + "_" + P_VIEWNAME + "idx", INDEX_TYPE.UNIQUE, P_VIEWNAME);
      type.createIndex(DB_CLASS + "_" + P_VIEWID + "idx", INDEX_TYPE.UNIQUE, P_VIEWID);
      log.info("Created schema: {}, properties: {}", type, type.properties());
    }
    return type;
  }
View Full Code Here

    OClass type = schema.getClass(DB_CLASS);
    if (type == null) {
      type = schema.createClass(DB_CLASS);

      type.createProperty(P_PATH, OType.STRING).setNotNull(true);
      type.createIndex(P_PATH + "idx", INDEX_TYPE.UNIQUE, P_PATH);
      type.createProperty(P_BLOBID, OType.STRING).setNotNull(true);
      type.createProperty(P_CONTENTTYPE, OType.STRING);

      log.info("Created schema: {}, properties: {}", type, type.properties());
    }
View Full Code Here

        final OClass type = schema.createClass(DB_CLASS);
        type.createProperty(P_TIMESTAMP, OType.LONG);
        type.createProperty(P_TYPE, OType.STRING);
        type.createProperty(P_SUBTYPE, OType.STRING);
        type.createProperty(P_DATA, OType.EMBEDDEDMAP, OType.STRING);
        type.createIndex(I_TYPE, INDEX_TYPE.NOTUNIQUE_HASH_INDEX, P_TYPE);
        type.createIndex(I_SUBTYPE, INDEX_TYPE.NOTUNIQUE_HASH_INDEX, P_SUBTYPE);

        log.info("Created schema: {}, properties: {}", type, type.properties());
      }
    }
View Full Code Here

        type.createProperty(P_TIMESTAMP, OType.LONG);
        type.createProperty(P_TYPE, OType.STRING);
        type.createProperty(P_SUBTYPE, OType.STRING);
        type.createProperty(P_DATA, OType.EMBEDDEDMAP, OType.STRING);
        type.createIndex(I_TYPE, INDEX_TYPE.NOTUNIQUE_HASH_INDEX, P_TYPE);
        type.createIndex(I_SUBTYPE, INDEX_TYPE.NOTUNIQUE_HASH_INDEX, P_SUBTYPE);

        log.info("Created schema: {}, properties: {}", type, type.properties());
      }
    }
View Full Code Here

    OSchema schema = db.getMetadata().getSchema();
    OClass book = schema.createClass("Book");
    book.createProperty("author", OType.STRING);
    book.createProperty("title", OType.STRING);
    book.createProperty("publicationYears", OType.EMBEDDEDLIST, OType.INTEGER);
    book.createIndex("books", "unique", "author", "title", "publicationYears");
  }

  @Test
  public void testIndexInsert() {
    db.command(
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.