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

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


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

    linkListIndexTestClass.createProperty("linkCollection", OType.LINKLIST);

    linkListIndexTestClass.createIndex("linkCollectionIndex", OClass.INDEX_TYPE.NOTUNIQUE, "linkCollection");
    database.getMetadata().getSchema().save();
  }

  @AfterClass
  public void destroySchema() {
View Full Code Here


    csp.setCollate(ODefaultCollate.NAME);

    OProperty cip = clazz.createProperty("cip", OType.STRING);
    cip.setCollate(OCaseInsensitiveCollate.NAME);

    clazz.createIndex("collateIndexCSP", OClass.INDEX_TYPE.NOTUNIQUE, "csp");
    clazz.createIndex("collateIndexCIP", OClass.INDEX_TYPE.NOTUNIQUE, "cip");

    for (int i = 0; i < 10; i++) {
      ODocument document = new ODocument("collateIndexTest");
View Full Code Here

    OProperty cip = clazz.createProperty("cip", OType.STRING);
    cip.setCollate(OCaseInsensitiveCollate.NAME);

    clazz.createIndex("collateIndexCSP", OClass.INDEX_TYPE.NOTUNIQUE, "csp");
    clazz.createIndex("collateIndexCIP", OClass.INDEX_TYPE.NOTUNIQUE, "cip");

    for (int i = 0; i < 10; i++) {
      ODocument document = new ODocument("collateIndexTest");

      if (i % 2 == 0) {
View Full Code Here

    OClass clazz = schema.createClass("collateWasChangedIndexTest");

    OProperty cp = clazz.createProperty("cp", OType.STRING);
    cp.setCollate(ODefaultCollate.NAME);

    clazz.createIndex("collateWasChangedIndex", OClass.INDEX_TYPE.NOTUNIQUE, "cp");

    for (int i = 0; i < 10; i++) {
      ODocument document = new ODocument("collateWasChangedIndexTest");

      if (i % 2 == 0)
View Full Code Here

    csp.setCollate(ODefaultCollate.NAME);

    OProperty cip = clazz.createProperty("cip", OType.STRING);
    cip.setCollate(OCaseInsensitiveCollate.NAME);

    clazz.createIndex("collateCompositeIndexCS", OClass.INDEX_TYPE.NOTUNIQUE, "csp", "cip");

    for (int i = 0; i < 10; i++) {
      ODocument document = new ODocument("CompositeIndexQueryCSTest");

      if (i % 2 == 0) {
View Full Code Here

    OProperty csp = clazz.createProperty("csp", OType.STRING);
    csp.setCollate(ODefaultCollate.NAME);

    clazz.createProperty("cip", OType.STRING);

    clazz.createIndex("collateCompositeIndexCollateWasChanged", OClass.INDEX_TYPE.NOTUNIQUE, "csp", "cip");

    for (int i = 0; i < 10; i++) {
      ODocument document = new ODocument("CompositeIndexQueryCollateWasChangedTest");
      if (i % 2 == 0) {
        document.field("csp", "VAL");
View Full Code Here

    orderByIndexReuse.createProperty("firstProp", OType.INTEGER);
    orderByIndexReuse.createProperty("secondProp", OType.INTEGER);
    orderByIndexReuse.createProperty("thirdProp", OType.STRING);
    orderByIndexReuse.createProperty("prop4", OType.STRING);

    orderByIndexReuse.createIndex("OrderByIndexReuseIndexSecondThirdProp", OClass.INDEX_TYPE.UNIQUE, "secondProp", "thirdProp");
    orderByIndexReuse.createIndex("OrderByIndexReuseIndexFirstPropNotUnique", OClass.INDEX_TYPE.NOTUNIQUE, "firstProp");

    for (int i = 0; i < 100; i++) {
      ODocument document = new ODocument("OrderByIndexReuse");
      document.field("firstProp", (101 - i) / 2);
View Full Code Here

    orderByIndexReuse.createProperty("secondProp", OType.INTEGER);
    orderByIndexReuse.createProperty("thirdProp", OType.STRING);
    orderByIndexReuse.createProperty("prop4", OType.STRING);

    orderByIndexReuse.createIndex("OrderByIndexReuseIndexSecondThirdProp", OClass.INDEX_TYPE.UNIQUE, "secondProp", "thirdProp");
    orderByIndexReuse.createIndex("OrderByIndexReuseIndexFirstPropNotUnique", OClass.INDEX_TYPE.NOTUNIQUE, "firstProp");

    for (int i = 0; i < 100; i++) {
      ODocument document = new ODocument("OrderByIndexReuse");
      document.field("firstProp", (101 - i) / 2);
      document.field("secondProp", (101 - i) / 2);
View Full Code Here

    graph.createEdgeType("link");
    graph.setAutoStartTx(false);

    OClass outVertexType = graph.createVertexType("IndexedOutVertex");
    outVertexType.createProperty("out_link", OType.LINKBAG);
    outVertexType.createIndex("uniqueLinkIndex", "unique", "out_link");

    graph.setAutoStartTx(true);


    Vertex vertexOutOne = graph.addVertex("class:IndexedOutVertex");
View Full Code Here

    if (!oc.existsProperty("name"))
      oc.createProperty("name", OType.STRING);

    if (oc.getClassIndex("vertexA_name_idx") == null)
      oc.createIndex("vertexA_name_idx", OClass.INDEX_TYPE.UNIQUE, "name");

    OClass ocb = graph.getVertexType("vertexB");
    if (ocb == null)
      ocb = graph.createVertexType("vertexB");
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.