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

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


        .createClass("Profile", database.getStorage().addCluster("profile", OStorage.CLUSTER_TYPE.PHYSICAL));
    profile.createProperty("nick", OType.STRING).setMin("3").setMax("30").createIndex(INDEX_TYPE.UNIQUE);
    profile.createProperty("name", OType.STRING).setMin("3").setMax("30").createIndex(INDEX_TYPE.NOTUNIQUE);
    profile.createProperty("surname", OType.STRING).setMin("3").setMax("30");
    profile.createProperty("registeredOn", OType.DATE).setMin("2010-01-01 00:00:00");
    profile.createProperty("lastAccessOn", OType.DATE).setMin("2010-01-01 00:00:00");

    OClass whiz = database.getMetadata().getSchema().createClass("Whiz");
    whiz.createProperty("id", OType.INTEGER);
    whiz.createProperty("account", OType.LINK, profile);
    whiz.createProperty("date", OType.DATE).setMin("2010-01-01 00:00:00");
View Full Code Here


    profile.createProperty("surname", OType.STRING).setMin("3").setMax("30");
    profile.createProperty("registeredOn", OType.DATE).setMin("2010-01-01 00:00:00");
    profile.createProperty("lastAccessOn", OType.DATE).setMin("2010-01-01 00:00:00");

    OClass whiz = database.getMetadata().getSchema().createClass("Whiz");
    whiz.createProperty("id", OType.INTEGER);
    whiz.createProperty("account", OType.LINK, profile);
    whiz.createProperty("date", OType.DATE).setMin("2010-01-01 00:00:00");
    whiz.createProperty("text", OType.STRING).setMandatory(true).setMin("1").setMax("140").createIndex(INDEX_TYPE.FULLTEXT);
    whiz.createProperty("replyTo", OType.LINK, profile);
View Full Code Here

    profile.createProperty("registeredOn", OType.DATE).setMin("2010-01-01 00:00:00");
    profile.createProperty("lastAccessOn", OType.DATE).setMin("2010-01-01 00:00:00");

    OClass whiz = database.getMetadata().getSchema().createClass("Whiz");
    whiz.createProperty("id", OType.INTEGER);
    whiz.createProperty("account", OType.LINK, profile);
    whiz.createProperty("date", OType.DATE).setMin("2010-01-01 00:00:00");
    whiz.createProperty("text", OType.STRING).setMandatory(true).setMin("1").setMax("140").createIndex(INDEX_TYPE.FULLTEXT);
    whiz.createProperty("replyTo", OType.LINK, profile);

    database.getMetadata().getSchema().save();
View Full Code Here

    profile.createProperty("lastAccessOn", OType.DATE).setMin("2010-01-01 00:00:00");

    OClass whiz = database.getMetadata().getSchema().createClass("Whiz");
    whiz.createProperty("id", OType.INTEGER);
    whiz.createProperty("account", OType.LINK, profile);
    whiz.createProperty("date", OType.DATE).setMin("2010-01-01 00:00:00");
    whiz.createProperty("text", OType.STRING).setMandatory(true).setMin("1").setMax("140").createIndex(INDEX_TYPE.FULLTEXT);
    whiz.createProperty("replyTo", OType.LINK, profile);

    database.getMetadata().getSchema().save();
    database.close();
View Full Code Here

    OClass whiz = database.getMetadata().getSchema().createClass("Whiz");
    whiz.createProperty("id", OType.INTEGER);
    whiz.createProperty("account", OType.LINK, profile);
    whiz.createProperty("date", OType.DATE).setMin("2010-01-01 00:00:00");
    whiz.createProperty("text", OType.STRING).setMandatory(true).setMin("1").setMax("140").createIndex(INDEX_TYPE.FULLTEXT);
    whiz.createProperty("replyTo", OType.LINK, profile);

    database.getMetadata().getSchema().save();
    database.close();
  }
View Full Code Here

    OClass whiz = database.getMetadata().getSchema().createClass("Whiz");
    whiz.createProperty("id", OType.INTEGER);
    whiz.createProperty("account", OType.LINK, profile);
    whiz.createProperty("date", OType.DATE).setMin("2010-01-01 00:00:00");
    whiz.createProperty("text", OType.STRING).setMandatory(true).setMin("1").setMax("140").createIndex(INDEX_TYPE.FULLTEXT);
    whiz.createProperty("replyTo", OType.LINK, profile);

    database.getMetadata().getSchema().save();
    database.close();
  }
View Full Code Here

  @Test
  public void geoSchema() {
    database.open("admin", "admin");

    final OClass mapPointClass = database.getMetadata().getSchema().createClass("MapPoint");
    mapPointClass.createProperty("x", OType.DOUBLE).createIndex(INDEX_TYPE.NOTUNIQUE);
    mapPointClass.createProperty("y", OType.DOUBLE).createIndex(INDEX_TYPE.NOTUNIQUE);

    final OPropertyIndex xIndex = database.getMetadata().getSchema().getClass("MapPoint").getProperty("x").getIndex();
    Assert.assertNotNull(xIndex);
View Full Code Here

  public void geoSchema() {
    database.open("admin", "admin");

    final OClass mapPointClass = database.getMetadata().getSchema().createClass("MapPoint");
    mapPointClass.createProperty("x", OType.DOUBLE).createIndex(INDEX_TYPE.NOTUNIQUE);
    mapPointClass.createProperty("y", OType.DOUBLE).createIndex(INDEX_TYPE.NOTUNIQUE);

    final OPropertyIndex xIndex = database.getMetadata().getSchema().getClass("MapPoint").getProperty("x").getIndex();
    Assert.assertNotNull(xIndex);

    final OPropertyIndex yIndex = database.getMetadata().getSchema().getClass("MapPoint").getProperty("y").getIndex();
View Full Code Here

  public static void create() {
    OClass account = database.getMetadata().getSchema()
        .createClass("Account", database.getStorage().addCluster("account", OStorage.CLUSTER_TYPE.PHYSICAL));
    account.createProperty("id", OType.LONG);
    account.createProperty("val1", OType.DOUBLE);
    account.createProperty("val2", OType.DOUBLE);
    account.createProperty("val3", OType.FLOAT);
    account.createProperty("val4", OType.SHORT);
    account.createProperty("val5", OType.STRING);
    account.createProperty("name", OType.STRING);
View Full Code Here

    OClass account = database.getMetadata().getSchema()
        .createClass("Account", database.getStorage().addCluster("account", OStorage.CLUSTER_TYPE.PHYSICAL));
    account.createProperty("id", OType.LONG);
    account.createProperty("val1", OType.DOUBLE);
    account.createProperty("val2", OType.DOUBLE);
    account.createProperty("val3", OType.FLOAT);
    account.createProperty("val4", OType.SHORT);
    account.createProperty("val5", OType.STRING);
    account.createProperty("name", OType.STRING);

    database.getMetadata().getSchema().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.