Package com.orientechnologies.orient.core.sql

Examples of com.orientechnologies.orient.core.sql.OCommandSQL


  }

  public OPropertyImpl setRegexp(final String iRegexp) {
    getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
    final String cmd = String.format("alter property %s regexp %s", getFullName(), iRegexp);
    getDatabase().command(new OCommandSQL(cmd)).execute();
    this.regexp = iRegexp;
    return this;
  }
View Full Code Here


  }

  public OPropertyImpl setType(final OType iType) {
    getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
    final String cmd = String.format("alter property %s type %s", getFullName(), iType.toString());
    getDatabase().command(new OCommandSQL(cmd)).execute();
    type = iType;
    return this;
  }
View Full Code Here

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

    ODocument doc = (ODocument) database.command(
        new OCommandSQL("insert into Profile (name, surname, salary, location, dummy) values ('Luca','Smith', 109.9, 13:3, name)"))
        .execute();

    Assert.assertTrue(doc != null);

    database.close();
View Full Code Here

            cmd.append(' ');

          cmd.append(iClusterIds[i]);
        }

      getDatabase().command(new OCommandSQL(cmd.toString())).execute();

      if (classes.containsKey(key))
        return classes.get(key);
      else
        // ADD IT LOCALLY AVOIDING TO RELOAD THE ENTIRE SCHEMA
View Full Code Here

            + " can't be dropped since has sub classes. Remove the dependencies before to drop it again");

      final StringBuilder cmd = new StringBuilder("drop class ");
      cmd.append(iClassName);

      getDatabase().command(new OCommandSQL(cmd.toString())).execute();
      reload();

    } finally {
      lock.releaseExclusiveLock();
    }
View Full Code Here

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

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

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

    database.close();
  }
View Full Code Here

  @Test(dependsOnMethods = "createProperty")
  public void createLinkedClassProperty() {
    database.open("admin", "admin");

    database.command(new OCommandSQL("create property account.knows embeddedmap account")).execute();

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

  @Test(dependsOnMethods = "createLinkedClassProperty")
  public void createLinkedTypeProperty() {
    database.open("admin", "admin");

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

    Assert.assertEquals(database.getMetadata().getSchema().getClass("account").getProperty("tags").getType(), OType.EMBEDDEDLIST);
    Assert.assertEquals(database.getMetadata().getSchema().getClass("account").getProperty("tags").getLinkedType(), OType.STRING);

    database.close();
View Full Code Here

  @Test(dependsOnMethods = "createLinkedTypeProperty")
  public void removeProperty() {
    database.open("admin", "admin");

    database.command(new OCommandSQL("remove property account.timesheet")).execute();
    database.command(new OCommandSQL("remove property account.tags")).execute();

    Assert.assertFalse(database.getMetadata().getSchema().getClass("account").existsProperty("timesheet"));
    Assert.assertFalse(database.getMetadata().getSchema().getClass("account").existsProperty("tags"));

    database.close();
View Full Code Here

   * @return the object itself.
   */
  public OClass setSuperClass(final OClass iSuperClass) {
    document.getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
    final String cmd = String.format("alter class %s superclass %s", name, iSuperClass.getName());
    document.getDatabase().command(new OCommandSQL(cmd)).execute();
    setSuperClassInternal(iSuperClass);
    return this;
  }
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.sql.OCommandSQL

Copyright © 2018 www.massapicom. 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.