Examples of OSchema


Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

    database.commit();
  }

  public void testRangeQuery() {
    final OSchema schema = database.getMetadata().getSchema();
    OClass clazz = schema.createClass("compositeIndexNullRangeQueryClass");
    clazz.createProperty("prop1", OType.INTEGER);
    clazz.createProperty("prop2", OType.INTEGER);
    clazz.createProperty("prop3", OType.INTEGER);

    final ODocument metadata = new ODocument();
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

  public void testRangeQueryInMiddleTx() {
    if (database.getURL().startsWith("remote:"))
      return;

    final OSchema schema = database.getMetadata().getSchema();
    OClass clazz = schema.createClass("compositeIndexNullRangeQueryInMiddleTxClass");
    clazz.createProperty("prop1", OType.INTEGER);
    clazz.createProperty("prop2", OType.INTEGER);
    clazz.createProperty("prop3", OType.INTEGER);

    final ODocument metadata = new ODocument();
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

    database.commit();
  }

  public void testPointQueryNullInTheMiddle() {
    final OSchema schema = database.getMetadata().getSchema();
    OClass clazz = schema.createClass("compositeIndexNullPointQueryNullInTheMiddleClass");
    clazz.createProperty("prop1", OType.INTEGER);
    clazz.createProperty("prop2", OType.INTEGER);
    clazz.createProperty("prop3", OType.INTEGER);

    final ODocument metadata = new ODocument();
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

  public void testPointQueryNullInTheMiddleInMiddleTx() {
    if (database.getURL().startsWith("remote:"))
      return;

    final OSchema schema = database.getMetadata().getSchema();
    OClass clazz = schema.createClass("compositeIndexNullPointQueryNullInTheMiddleInMiddleTxClass");
    clazz.createProperty("prop1", OType.INTEGER);
    clazz.createProperty("prop2", OType.INTEGER);
    clazz.createProperty("prop3", OType.INTEGER);

    final ODocument metadata = new ODocument();
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

    database.commit();
  }

  public void testRangeQueryNullInTheMiddle() {
    final OSchema schema = database.getMetadata().getSchema();
    OClass clazz = schema.createClass("compositeIndexNullRangeQueryNullInTheMiddleClass");
    clazz.createProperty("prop1", OType.INTEGER);
    clazz.createProperty("prop2", OType.INTEGER);
    clazz.createProperty("prop3", OType.INTEGER);

    final ODocument metadata = new ODocument();
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

  public void testRangeQueryNullInTheMiddleInMiddleTx() {
    if (database.getURL().startsWith("remote:"))
      return;

    final OSchema schema = database.getMetadata().getSchema();
    OClass clazz = schema.createClass("compositeIndexNullRangeQueryNullInTheMiddleInMiddleTxClass");
    clazz.createProperty("prop1", OType.INTEGER);
    clazz.createProperty("prop2", OType.INTEGER);
    clazz.createProperty("prop3", OType.INTEGER);

    final ODocument metadata = new ODocument();
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

    student5.field("diploma", diploma3);
    student5.save();
  }

  private void createSchemaForTest() {
    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);

      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");
      skillClass.createProperty("name", OType.STRING).createIndex(OClass.INDEX_TYPE.UNIQUE);

      final OClass studentClass = schema.createClass("lpirtStudent");
      studentClass.createProperty("name", OType.STRING).createIndex(OClass.INDEX_TYPE.UNIQUE);
      studentClass.createProperty("group", OType.LINK, groupClass).createIndex(OClass.INDEX_TYPE.NOTUNIQUE);
      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

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

  }

  private void createSchema(ODatabaseDocumentTx databaseDocumentTx) {
    ODatabaseRecordThreadLocal.INSTANCE.set(databaseDocumentTx);

    OSchema schema = databaseDocumentTx.getMetadata().getSchema();
    OClass testOneClass = schema.createClass("TestOne");

    testOneClass.createProperty("intProp", OType.INTEGER);
    testOneClass.createProperty("stringProp", OType.STRING);
    testOneClass.createProperty("stringSet", OType.EMBEDDEDSET, OType.STRING);
    testOneClass.createProperty("linkMap", OType.LINKMAP, OType.STRING);

    OClass testTwoClass = schema.createClass("TestTwo");

    testTwoClass.createProperty("stringList", OType.EMBEDDEDLIST, OType.STRING);
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

    }
    if (!db.exists()) {
      db.create();
      System.out.println("Created database.");

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

      // Create Person class
      final OClass personClass = schema.createClass("Person");
      personClass.createProperty("First", OType.STRING).setMandatory(true).setNotNull(true).setMin("1");

      System.out.println("Created schema.");
    } else {
      db.open("admin", "admin");
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

  @BeforeMethod
  public void before() {
    ODatabaseDocumentTx.setDefaultSerializer(serializer);
    databaseDocument = new ODatabaseDocumentTx("memory:" + ODocumentSchemafullSerializationTest.class.getSimpleName()).create();
    // databaseDocument.getMetadata().
    OSchema schema = databaseDocument.getMetadata().getSchema();
    address = schema.createClass("Address");
    address.createProperty(NAME, OType.STRING);
    address.createProperty(NUMBER, OType.INTEGER);
    address.createProperty(CITY, OType.STRING);

    simple = schema.createClass("Simple");
    simple.createProperty(STRING_FIELD, OType.STRING);
    simple.createProperty(INT_FIELD, OType.INTEGER);
    simple.createProperty(SHORT_FIELD, OType.SHORT);
    simple.createProperty(LONG_FIELD, OType.LONG);
    simple.createProperty(FLOAT_NUMBER, OType.FLOAT);
    simple.createProperty(DOUBLE_NUMBER, OType.DOUBLE);
    simple.createProperty(BYTE_FIELD, OType.BYTE);
    simple.createProperty(BOOLEAN_FIELD, OType.BOOLEAN);
    simple.createProperty(DATE_FIELD, OType.DATETIME);
    simple.createProperty(RECORDID_FIELD, OType.LINK);
    simple.createProperty(EMBEDDED_FIELD, OType.EMBEDDED, address);

    embSimp = schema.createClass("EmbeddedCollectionSimple");
    embSimp.createProperty(LIST_BOOLEANS, OType.EMBEDDEDLIST);
    embSimp.createProperty(LIST_BYTES, OType.EMBEDDEDLIST);
    embSimp.createProperty(LIST_DATES, OType.EMBEDDEDLIST);
    embSimp.createProperty(LIST_DOUBLES, OType.EMBEDDEDLIST);
    embSimp.createProperty(LIST_FLOATS, OType.EMBEDDEDLIST);
    embSimp.createProperty(LIST_INTEGERS, OType.EMBEDDEDLIST);
    embSimp.createProperty(LIST_LONGS, OType.EMBEDDEDLIST);
    embSimp.createProperty(LIST_SHORTS, OType.EMBEDDEDLIST);
    embSimp.createProperty(LIST_STRINGS, OType.EMBEDDEDLIST);
    embSimp.createProperty(LIST_MIXED, OType.EMBEDDEDLIST);

    embMapSimple = schema.createClass("EmbeddedMapSimple");
    embMapSimple.createProperty(MAP_BYTES, OType.EMBEDDEDMAP);
    embMapSimple.createProperty(MAP_DATE, OType.EMBEDDEDMAP);
    embMapSimple.createProperty(MAP_DOUBLE, OType.EMBEDDEDMAP);
    embMapSimple.createProperty(MAP_FLOAT, OType.EMBEDDEDMAP);
    embMapSimple.createProperty(MAP_INT, OType.EMBEDDEDMAP);
    embMapSimple.createProperty(MAP_LONG, OType.EMBEDDEDMAP);
    embMapSimple.createProperty(MAP_SHORT, OType.EMBEDDEDMAP);
    embMapSimple.createProperty(MAP_STRING, OType.EMBEDDEDMAP);

    OClass clazzEmbComp = schema.createClass("EmbeddedComplex");
    clazzEmbComp.createProperty("addresses", OType.EMBEDDEDLIST, address);
    clazzEmbComp.createProperty("uniqueAddresses", OType.EMBEDDEDSET, address);
    clazzEmbComp.createProperty("addressByStreet", OType.EMBEDDEDMAP, address);
  }
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.