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

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema.createClass()


  }

  @Test
  public void testReuseOfIndexOnSeveralClassesFields() {
    final OSchema schema = database.getMetadata().getSchema();
    final OClass superClass = schema.createClass("sqlSelectHashIndexReuseTestSuperClass");
    superClass.createProperty("prop0", OType.INTEGER);
    final OClass oClass = schema.createClass("sqlSelectHashIndexReuseTestChildClass", superClass);
    oClass.createProperty("prop1", OType.INTEGER);

    oClass.createIndex("sqlSelectHashIndexReuseTestOnPropertiesFromClassAndSuperclass", OClass.INDEX_TYPE.UNIQUE_HASH_INDEX,
View Full Code Here


  @Test
  public void testReuseOfIndexOnSeveralClassesFields() {
    final OSchema schema = database.getMetadata().getSchema();
    final OClass superClass = schema.createClass("sqlSelectHashIndexReuseTestSuperClass");
    superClass.createProperty("prop0", OType.INTEGER);
    final OClass oClass = schema.createClass("sqlSelectHashIndexReuseTestChildClass", superClass);
    oClass.createProperty("prop1", OType.INTEGER);

    oClass.createIndex("sqlSelectHashIndexReuseTestOnPropertiesFromClassAndSuperclass", OClass.INDEX_TYPE.UNIQUE_HASH_INDEX,
        "prop0", "prop1");
View Full Code Here

  public void beforeClass() {
    if (database.isClosed())
      database.open("admin", "admin");

    final OSchema schema = database.getMetadata().getSchema();
    final OClass oClass = schema.createClass("SQLDropClassTestClass");
    oClass.createProperty("prop1", EXPECTED_PROP1_TYPE);
    oClass.createProperty("prop2", EXPECTED_PROP2_TYPE);

    schema.save();
    database.close();
View Full Code Here

    if (database.isClosed())
      database.open("admin", "admin");

    final OSchema schema = database.getMetadata().getSchema();
    schema.createClass(TEST_CLASS);
    schema.save();

    database.close();
  }
View Full Code Here

  public void beforeClass() throws Exception {
    super.beforeClass();

    final OSchema schema = database.getMetadata().getSchema();

    final OClass testClass = schema.createClass("SQLSelectCompositeIndexDirectSearchTestClass");
    testClass.createProperty("prop1", OType.INTEGER);
    testClass.createProperty("prop2", OType.INTEGER);
    schema.save();

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

    checkNotNull(db);

    OSchema schema = db.getMetadata().getSchema();
    OClass type = schema.getClass(DB_CLASS);
    if (type == null) {
      type = schema.createClass(DB_CLASS);

      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);
View Full Code Here

  @Test
  public void schema() throws Exception {
    try (ODatabaseDocumentTx db = createDatabase()) {
      OSchema schema = db.getMetadata().getSchema();
      OClass eventData = schema.createClass("EventData");
      eventData.createProperty("type", OType.STRING);
      eventData.createProperty("timestamp", OType.LONG);
      eventData.createProperty("userId", OType.STRING);
      eventData.createProperty("sessionId", OType.STRING);
      eventData.createProperty("attributes", OType.EMBEDDEDMAP);
View Full Code Here

  @Test
  public void maxClusters() throws Exception {
    log(" * Create database");
    try (ODatabaseDocumentTx db = createDatabase()) {
      OSchema schema = db.getMetadata().getSchema();
      OClass type = schema.createClass("Message");
      type.setClusterSelection(ODefaultClusterSelectionStrategy.NAME);
      type.createProperty("text", OType.STRING);
    }

    try (ODatabaseDocumentTx db = openDatabase()) {
View Full Code Here

  @Test
  public void clusterReUse() throws Exception {
    log(" * Create database");
    try (ODatabaseDocumentTx db = createDatabase()) {
      OSchema schema = db.getMetadata().getSchema();
      OClass type = schema.createClass("Message");
      type.setClusterSelection(ODefaultClusterSelectionStrategy.NAME);
      type.createProperty("text", OType.STRING);
    }

    for (int c = 0; c < 4; c++) {
View Full Code Here

    checkNotNull(db);

    OSchema schema = db.getMetadata().getSchema();
    OClass type = schema.getClass(DB_CLASS);
    if (type == null) {
      type = schema.createClass(DB_CLASS);

      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);
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.