Examples of OSchema


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

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

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

    oClass = schema.createClass("ClassIndexTestClass");
    oSuperClass = schema.createClass("ClassIndexTestSuperClass");

    oClass.createProperty("fOne", OType.INTEGER);
    oClass.createProperty("fTwo", OType.STRING);
    oClass.createProperty("fThree", OType.BOOLEAN);
    oClass.createProperty("fFour", OType.INTEGER);

    oClass.createProperty("fSix", OType.STRING);
    oClass.createProperty("fSeven", OType.STRING);

    oClass.createProperty("fEight", OType.INTEGER);
    oClass.createProperty("fTen", OType.INTEGER);
    oClass.createProperty("fEleven", OType.INTEGER);
    oClass.createProperty("fTwelve", OType.INTEGER);
    oClass.createProperty("fThirteen", OType.INTEGER);
    oClass.createProperty("fFourteen", OType.INTEGER);
    oClass.createProperty("fFifteen", OType.INTEGER);

    oClass.createProperty("fEmbeddedMap", OType.EMBEDDEDMAP, OType.INTEGER);
    oClass.createProperty("fEmbeddedMapWithoutLinkedType", OType.EMBEDDEDMAP);
    oClass.createProperty("fLinkMap", OType.LINKMAP);

    oClass.createProperty("fLinkList", OType.LINKLIST);
    oClass.createProperty("fEmbeddedList", OType.EMBEDDEDLIST, OType.INTEGER);

    oClass.createProperty("fEmbeddedSet", OType.EMBEDDEDSET, OType.INTEGER);
    oClass.createProperty("fLinkSet", OType.LINKSET);

    oClass.createProperty("fRidBag", OType.LINKBAG);

    oSuperClass.createProperty("fNine", OType.INTEGER);
    oClass.setSuperClass(oSuperClass);

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

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

  public void testCreateVertexByContent() {
    OrientGraph graph = new OrientGraph(database, false);
    graph.shutdown();
    database.open("admin", "admin");

    OSchema schema = database.getMetadata().getSchema();
    if (!schema.existsClass("CreateVertexByContent")) {
      OClass vClass = schema.createClass("CreateVertexByContent", schema.getClass("V"));
      vClass.createProperty("message", OType.STRING);
    }

    database.command(new OCommandSQL("create vertex CreateVertexByContent content { \"message\": \"(:\"}")).execute();
    database.command(new OCommandSQL("create vertex CreateVertexByContent content { \"message\": \"\\\"‎ה, כן?...‎\\\"\"}")).execute();
View Full Code Here

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

  @BeforeMethod
  public void beforeMethod() throws Exception {
    super.beforeMethod();

    final OSchema schema = database.getMetadata().getSchema();
    final OClass superTest = schema.createClass("SchemaSharedIndexSuperTest");
    final OClass test = schema.createClass("SchemaIndexTest", superTest);
    test.createProperty("prop1", OType.DOUBLE);
    test.createProperty("prop2", OType.DOUBLE);

    schema.save();
  }
View Full Code Here

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

    Assert.assertNotNull(database.getMetadata().getIndexManager().getIndex("SchemaSharedIndexCompositeIndex"));
  }

  public void testPolymorphicIdsPropagationAfterClusterAddRemove() {
    final OSchema schema = database.getMetadata().getSchema();

    OClass polymorpicIdsPropagationSuperSuper = schema.getClass("polymorpicIdsPropagationSuperSuper");

    if (polymorpicIdsPropagationSuperSuper == null)
      polymorpicIdsPropagationSuperSuper = schema.createClass("polymorpicIdsPropagationSuperSuper");

    OClass polymorpicIdsPropagationSuper = schema.getClass("polymorpicIdsPropagationSuper");
    if (polymorpicIdsPropagationSuper == null)
      polymorpicIdsPropagationSuper = schema.createClass("polymorpicIdsPropagationSuper");

    OClass polymorpicIdsPropagation = schema.getClass("polymorpicIdsPropagation");
    if (polymorpicIdsPropagation == null)
      polymorpicIdsPropagation = schema.createClass("polymorpicIdsPropagation");

    polymorpicIdsPropagation.setSuperClass(polymorpicIdsPropagationSuper);
    polymorpicIdsPropagationSuper.setSuperClass(polymorpicIdsPropagationSuperSuper);

    polymorpicIdsPropagationSuperSuper.createProperty("value", OType.STRING);
View Full Code Here

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

  public CollateTest(@Optional String url) {
    super(url);
  }

  public void testQuery() {
    final OSchema schema = database.getMetadata().getSchema();
    OClass clazz = schema.createClass("collateTest");

    OProperty csp = clazz.createProperty("csp", OType.STRING);
    csp.setCollate(ODefaultCollate.NAME);

    OProperty cip = clazz.createProperty("cip", OType.STRING);
View Full Code Here

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

    for (ODocument document : result)
      Assert.assertEquals((document.<String> field("cip")).toUpperCase(), "VAL");
  }

  public void testIndexQuery() {
    final OSchema schema = database.getMetadata().getSchema();
    OClass clazz = schema.createClass("collateIndexTest");

    OProperty csp = clazz.createProperty("csp", OType.STRING);
    csp.setCollate(ODefaultCollate.NAME);

    OProperty cip = clazz.createProperty("cip", OType.STRING);
View Full Code Here

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

    explain = database.command(new OCommandSQL("explain " + query)).execute();
    Assert.assertTrue(explain.<Set<String>> field("involvedIndexes").contains("collateIndexCIP"));
  }

  public void testIndexQueryCollateWasChanged() {
    final OSchema schema = database.getMetadata().getSchema();
    OClass clazz = schema.createClass("collateWasChangedIndexTest");

    OProperty cp = clazz.createProperty("cp", OType.STRING);
    cp.setCollate(ODefaultCollate.NAME);

    clazz.createIndex("collateWasChangedIndex", OClass.INDEX_TYPE.NOTUNIQUE, "cp");
View Full Code Here

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

    explain = database.command(new OCommandSQL("explain " + query)).execute();
    Assert.assertTrue(explain.<Set<String>> field("involvedIndexes").contains("collateWasChangedIndex"));
  }

  public void testCompositeIndexQueryCS() {
    final OSchema schema = database.getMetadata().getSchema();
    OClass clazz = schema.createClass("CompositeIndexQueryCSTest");

    OProperty csp = clazz.createProperty("csp", OType.STRING);
    csp.setCollate(ODefaultCollate.NAME);

    OProperty cip = clazz.createProperty("cip", OType.STRING);
View Full Code Here

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

      Assert.assertEquals((record.<String> field("cip")).toUpperCase(), "VAL");
    }
  }

  public void testCompositeIndexQueryCollateWasChanged() {
    final OSchema schema = database.getMetadata().getSchema();
    OClass clazz = schema.createClass("CompositeIndexQueryCollateWasChangedTest");

    OProperty csp = clazz.createProperty("csp", OType.STRING);
    csp.setCollate(ODefaultCollate.NAME);

    clazz.createProperty("cip", OType.STRING);
View Full Code Here

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

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

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

    schema.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.