Examples of existsClass()


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

  @SuppressWarnings("unchecked")
  public void createGraphInTx() {
    final OSchema schema = database.getMetadata().getSchema();

    if (!schema.existsClass("Profile"))
      schema.createClass("Profile");

    database.begin();

    ODocument kim = new ODocument("Profile").field("name", "Kim").field("surname", "Bauer");
View Full Code Here

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

        return null;
      }
    };

    final OSchema schema = database.getMetadata().getSchema();
    if (!schema.existsClass("NestedTxClass"))
      schema.createClass("NestedTxClass");

    database.begin();

    final ODocument externalDocOne = new ODocument("NestedTxClass");
View Full Code Here

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

        return null;
      }
    };

    final OSchema schema = database.getMetadata().getSchema();
    if (!schema.existsClass("NestedTxRollbackOne"))
      schema.createClass("NestedTxRollbackOne");

    ODocument brokenDocOne = new ODocument("NestedTxRollbackOne");
    brokenDocOne.save();
View Full Code Here

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

    Assert.assertEquals(database.countClass("NestedTxRollbackOne"), 1);
  }

  public void testNestedTxRollbackTwo() {
    final OSchema schema = database.getMetadata().getSchema();
    if (!schema.existsClass("NestedTxRollbackTwo"))
      schema.createClass("NestedTxRollbackTwo");

    database.begin();
    try {
      final ODocument externalDocOne = new ODocument("NestedTxRollbackTwo");
View Full Code Here

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

    // create the schema for the test class if it doesn't exist
    ODatabaseDocumentTx db = pool.acquire();
    try {
      OSchema schema = db.getMetadata().getSchema();
      if (!schema.existsClass(CLASSNAME)) {
        OClass oc = schema.createClass(CLASSNAME);
        oc.createProperty(PROPKEY, OType.STRING);
        oc.setStrictMode(true);
        schema.save();
      }
View Full Code Here

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

    super(url);
  }

  public void createProperty() {
    OSchema schema = database.getMetadata().getSchema();
    if (!schema.existsClass("account"))
      schema.createClass("account");

    database.command(new OCommandSQL("create property account.timesheet string")).execute();

    Assert.assertEquals(database.getMetadata().getSchema().getClass("account").getProperty("timesheet").getType(), OType.STRING);
View Full Code Here

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

                // TODO handle Oversize
                String entityName = javaClass.getSimpleName();
                info("Entity: %s", javaClass.getName());
                db.getEntityManager().registerEntityClass(javaClass);
                OSchema schema = db.getMetadata().getSchema();
                if (!schema.existsClass(entityName)) {
                    info("Schema: %s", entityName);
                    schema.createClass(javaClass);
                    schema.save();
                }
            }
View Full Code Here

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

    if (iClassName == null)
      return null;

    final OSchema schema = graph.getRawGraph().getMetadata().getSchema();

    if (!schema.existsClass(iClassName)) {
      // CREATE A NEW CLASS AT THE FLY
      try {
        graph.executeOutsideTx(
            new OCallable<OClass, OrientBaseGraph>() {
View Full Code Here

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

            "' as subclass of '",
            getBaseClassName(),
            "'. The transaction will be reopen right after that. To avoid this behavior create the classes outside the transaction");

      } catch (OSchemaException e) {
        if (!schema.existsClass(iClassName))
          throw e;
      }
    } else {
      // CHECK THE CLASS INHERITANCE
      final OClass cls = schema.getClass(iClassName);
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.