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

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


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

    final OSchema schema = database.getMetadata().getSchema();
    final OClass oClass = schema.createClass("sqlSelectIndexReuseTestClass");

    oClass.createProperty("prop1", OType.INTEGER);
    oClass.createProperty("prop2", OType.INTEGER);
    oClass.createProperty("prop3", OType.INTEGER);
    oClass.createProperty("prop4", OType.INTEGER);
View Full Code Here


  }

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

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

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

    oClass.createIndex("sqlSelectIndexReuseTestOnPropertiesFromClassAndSuperclass", OClass.INDEX_TYPE.UNIQUE, "prop0", "prop1");

    schema.save();
View Full Code Here

    final OSchema schema = db.getMetadata().getSchema();
    OClass person = schema.getClass("Person");
    person.createIndex("Person.name", INDEX_TYPE.UNIQUE, "name");

    OClass customer = schema.createClass("Customer", person);
    customer.createProperty("totalSold", OType.DECIMAL);

    OClass provider = schema.createClass("Provider", person);
    provider.createProperty("totalPurchased", OType.DECIMAL);
View Full Code Here

    person.createIndex("Person.name", INDEX_TYPE.UNIQUE, "name");

    OClass customer = schema.createClass("Customer", person);
    customer.createProperty("totalSold", OType.DECIMAL);

    OClass provider = schema.createClass("Provider", person);
    provider.createProperty("totalPurchased", OType.DECIMAL);

    new ODocument("Customer").fields("name", "Jay", "surname", "Miner").save();
    new ODocument("Customer").fields("name", "Luke", "surname", "Skywalker").save();
    new ODocument("Provider").fields("name", "Yoda", "surname", "Nothing").save();
View Full Code Here

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

    final OSchema schema = database.getMetadata().getSchema();
    final OClass clazz = schema.createClass("BetweenConversionTest");
    clazz.createProperty("a", OType.INTEGER);
    clazz.createProperty("ai", OType.INTEGER);

    clazz.createIndex("BetweenConversionTestIndex", OClass.INDEX_TYPE.NOTUNIQUE, "ai");
View Full Code Here

    }

    db.create();

    final OSchema schema = db.getMetadata().getSchema();
    schema.createClass("User", schema.getClass("V"));
    schema.createClass("Folder", schema.getClass("V"));
    schema.createClass("CanAccess", schema.getClass("E"));
  }

  @AfterClass
View Full Code Here

    db.create();

    final OSchema schema = db.getMetadata().getSchema();
    schema.createClass("User", schema.getClass("V"));
    schema.createClass("Folder", schema.getClass("V"));
    schema.createClass("CanAccess", schema.getClass("E"));
  }

  @AfterClass
  public static void tearDown() throws Exception {
View Full Code Here

    db.create();

    final OSchema schema = db.getMetadata().getSchema();
    schema.createClass("User", schema.getClass("V"));
    schema.createClass("Folder", schema.getClass("V"));
    schema.createClass("CanAccess", schema.getClass("E"));
  }

  @AfterClass
  public static void tearDown() throws Exception {
    db.drop();
View Full Code Here

    }

    db.create();

    final OSchema schema = db.getMetadata().getSchema();
    schema.createClass("Owner", schema.getClass("V"));
    schema.createClass("link", schema.getClass("E"));

    owner1 = new ODocument("Owner");
    owner1.field("id", 1);
    owner1.save();
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.