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

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


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

  public class DataPropagationTask implements Callable<Void> {
View Full Code Here


      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

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

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

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

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

    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

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

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

  public class DataPropagationTask implements Callable<Void> {
View Full Code Here

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

    final OSchema schema = database.getMetadata().getSchema();
    final OClass oClass = schema.createClass("sqlCreateIndexTestClass");
    oClass.createProperty("prop1", EXPECTED_PROP1_TYPE);
    oClass.createProperty("prop2", EXPECTED_PROP2_TYPE);
    oClass.createProperty("prop3", OType.EMBEDDEDMAP, OType.INTEGER);
    oClass.createProperty("prop5", OType.EMBEDDEDLIST, OType.INTEGER);
    oClass.createProperty("prop6", OType.EMBEDDEDLIST);
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.