Package com.orientechnologies.orient.core.sql

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


  }

  public OClass setName(final String iName) {
    document.getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
    final String cmd = String.format("alter class %s name %s", name, iName);
    document.getDatabase().command(new OCommandSQL(cmd)).execute();
    name = iName;
    return this;
  }
View Full Code Here


  }

  public OClass setShortName(final String iShortName) {
    document.getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
    final String cmd = String.format("alter class %s shortname %s", name, iShortName);
    document.getDatabase().command(new OCommandSQL(cmd)).execute();
    setShortNameInternal(iShortName);
    return this;
  }
View Full Code Here

    // CLASS.PROPERTY NAME
    cmd.append(name);
    cmd.append('.');
    cmd.append(iPropertyName);

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

    if (existsProperty(iPropertyName))
      properties.remove(lowerName);
  }
View Full Code Here

      // TYPE
      cmd.append(' ');
      cmd.append(iLinkedClass.getName());
    }

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

    if (existsProperty(iPropertyName))
      return properties.get(lowerName);
    else {
      // ADD IT LOCALLY AVOIDING TO RELOAD THE ENTIRE SCHEMA
View Full Code Here

  }

  public OClass setOverSize(final float overSize) {
    document.getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
    final String cmd = String.format("alter class %s oversize %f", name, overSize);
    document.getDatabase().command(new OCommandSQL(cmd)).execute();
    setOverSizeInternal(overSize);
    return this;
  }
View Full Code Here

  @Test
  public void findSimpleReference() {
    if (database.isClosed())
      database.open("admin", "admin");

    Collection<ORID> result = database.command(new OCommandSQL("find references 14:58")).execute();

    Assert.assertTrue(result.size() == 1);
    Assert.assertTrue(result.iterator().next().toString().equals("#13:54"));

    result = database.command(new OCommandSQL("find references 19:0")).execute();

    Assert.assertTrue(result.size() == 2);
    ORID rid = result.iterator().next();
    Assert.assertTrue(rid.toString().equals("#22:0") || rid.toString().equals("#21:0"));
    rid = result.iterator().next();
    Assert.assertTrue(rid.toString().equals("#22:0") || rid.toString().equals("#21:0"));

    result = database.command(new OCommandSQL("find references 9:0")).execute();
    Assert.assertTrue(result.size() == 0);

    result.clear();
    result = null;
View Full Code Here

  @Test
  public void findReferenceByClassAndClusters() {
    if (database.isClosed())
      database.open("admin", "admin");

    Collection<ORID> result = database.command(new OCommandSQL("find references 19:0 [GraphCar]")).execute();

    Assert.assertTrue(result.size() == 1);
    Assert.assertTrue(result.iterator().next().toString().equals("#21:0"));

    result = database.command(new OCommandSQL("find references 19:0 [company,cluster:GraphMotocycle]")).execute();

    Assert.assertTrue(result.size() == 1);
    Assert.assertTrue(result.iterator().next().toString().equals("#22:0"));

    result = database.command(new OCommandSQL("find references 19:0 [company,account,cluster:OGraphEdge]")).execute();

    Assert.assertTrue(result.size() == 0);

    result.clear();
    result = null;
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

  }

  public OClass setName(final String iName) {
    document.getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
    final String cmd = String.format("alter class %s name %s", name, iName);
    document.getDatabase().command(new OCommandSQL(cmd)).execute();
    name = iName;
    return this;
  }
View Full Code Here

  }

  public OClass setShortName(final String iShortName) {
    document.getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
    final String cmd = String.format("alter class %s shortname %s", name, iShortName);
    document.getDatabase().command(new OCommandSQL(cmd)).execute();
    setShortNameInternal(iShortName);
    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.