Examples of createIndex()


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

      testClass.createProperty("id", OType.LONG);
      testClass.createProperty("timestamp", OType.LONG);
      testClass.createProperty("stringValue", OType.STRING);
      testClass.createProperty("binaryValue", OType.BINARY);

      testClass.createIndex("idIndex", OClass.INDEX_TYPE.UNIQUE, "id");

      schema.save();
    }
  }
View Full Code Here

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

      OClass testClass = schema.createClass("TestClass");
      testClass.createProperty("id", OType.INTEGER);
      testClass.createProperty("timestamp", OType.LONG);
      testClass.createProperty("stringValue", OType.STRING);

      testClass.createIndex("idIndex", OClass.INDEX_TYPE.UNIQUE, "id");

      schema.save();
    }
  }
View Full Code Here

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

      OClass testClass = schema.createClass("TestClass");
      testClass.createProperty("id", OType.LONG);
      testClass.createProperty("timestamp", OType.LONG);
      testClass.createProperty("stringValue", OType.STRING);

      testClass.createIndex("idIndex", OClass.INDEX_TYPE.UNIQUE, "id");

      schema.save();
    }
  }
View Full Code Here

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

    final OClass mapper = database.getMetadata().getSchema().getClass("Mapper");
    mapper.createProperty("id", OType.STRING);
    mapper.createProperty("intMap", OType.EMBEDDEDMAP, OType.INTEGER);

    mapper.createIndex("mapIndexTestKey", OClass.INDEX_TYPE.NOTUNIQUE, "intMap");
    mapper.createIndex("mapIndexTestValue", OClass.INDEX_TYPE.NOTUNIQUE, "intMap by value");

    final OClass movie = database.getMetadata().getSchema().createClass("MapIndexTestMovie");
    movie.createProperty("title", OType.STRING);
    movie.createProperty("thumbs", OType.EMBEDDEDMAP, OType.INTEGER);
View Full Code Here

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

    final OClass mapper = database.getMetadata().getSchema().getClass("Mapper");
    mapper.createProperty("id", OType.STRING);
    mapper.createProperty("intMap", OType.EMBEDDEDMAP, OType.INTEGER);

    mapper.createIndex("mapIndexTestKey", OClass.INDEX_TYPE.NOTUNIQUE, "intMap");
    mapper.createIndex("mapIndexTestValue", OClass.INDEX_TYPE.NOTUNIQUE, "intMap by value");

    final OClass movie = database.getMetadata().getSchema().createClass("MapIndexTestMovie");
    movie.createProperty("title", OType.STRING);
    movie.createProperty("thumbs", OType.EMBEDDEDMAP, OType.INTEGER);
View Full Code Here

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

    final OClass movie = database.getMetadata().getSchema().createClass("MapIndexTestMovie");
    movie.createProperty("title", OType.STRING);
    movie.createProperty("thumbs", OType.EMBEDDEDMAP, OType.INTEGER);

    movie.createIndex("indexForMap", OClass.INDEX_TYPE.NOTUNIQUE, "thumbs by key");
  }

  @AfterClass
  public void destroySchema() {
    database.open("admin", "admin");
View Full Code Here

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

        OProperty p = database.getMetadata().getSchema().getClass("Account").getProperty("id");
        if (p == null)
          p = database.getMetadata().getSchema().getClass("Account").createProperty("id", OType.INTEGER);

        if (!p.isIndexed())
          p.createIndex(INDEX_TYPE.NOTUNIQUE);
      }
    }

    public void cycle() {
      record.reset();
View Full Code Here

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

        OProperty p = database.getMetadata().getSchema().getClass("Account").getProperty("id");
        if (p == null)
          p = database.getMetadata().getSchema().getClass("Account").createProperty("id", OType.INTEGER);

        if (!p.isIndexed())
          p.createIndex(INDEX_TYPE.NOTUNIQUE);
      }
    }

    public void cycle() {
      record.reset();
View Full Code Here

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

    OProperty prop = cls.getProperty(field);
    if (prop == null)
      throw new IllegalArgumentException("Property '" + field + "' was not found in class '" + cls + "'");

    prop.createIndex(indexType.toUpperCase(), progressListener);

    return prop.getIndex().getUnderlying().size();
  }
}
View Full Code Here

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

        if (fields.get("min") != null)
          prop.setMin(fields.get("min"));
        if (fields.get("max") != null)
          prop.setMax(fields.get("max"));
        if (fields.get("indexed") != null)
          prop.createIndex(fields.get("indexed").equals("Unique") ? OProperty.INDEX_TYPE.UNIQUE : OProperty.INDEX_TYPE.NOTUNIQUE);

        db.getMetadata().getSchema().save();

        sendTextContent(iRequest, OHttpUtils.STATUS_OK_CODE, "OK", null, OHttpUtils.CONTENT_TEXT_PLAIN,
            "Property " + fields.get("name") + " created successfully with id=" + prop.getId());
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.