Package com.orientechnologies.orient.core.db.record

Examples of com.orientechnologies.orient.core.db.record.ODatabaseRecord


    case STATUS:
      return getStatus();
    case DEFAULTCLUSTERID:
      return getDefaultClusterId();
    case TYPE:
      final ODatabaseRecord db = getDatabaseOwner();

      return db.getMetadata().getSchema().existsClass("V") ? "graph" : "document";
    case DATEFORMAT:
      return storage.getConfiguration().dateFormat;

    case DATETIMEFORMAT:
      return storage.getConfiguration().dateTimeFormat;
View Full Code Here


   */
  public Object execute(final Map<Object, Object> iArgs) {
    if (className == null)
      throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");

    final ODatabaseRecord database = getDatabase();
    final OClass oClass = database.getMetadata().getSchema().getClass(className);
    if (oClass == null)
      return null;

    database.getMetadata().getSchema().dropClass(className);
    return true;
  }
View Full Code Here

   */
  public Object execute(final Map<Object, Object> iArgs) {
    if (className == null)
      throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");

    final ODatabaseRecord database = getDatabase();
    database.getMetadata().getSchema().createClass(className, superClass, clusterIds);

    return database.getMetadata().getSchema().getClasses().size();
  }
View Full Code Here

    database.dropCluster(clusterId, true);
    return true;
  }

  protected boolean isClusterDeletable(int clusterId) {
    final ODatabaseRecord database = getDatabase();
    for (OClass iClass : database.getMetadata().getSchema().getClasses()) {
      for (int i : iClass.getClusterIds()) {
        if (i == clusterId)
          return false;
      }
    }
View Full Code Here

*
*/
public class ODatabaseFunctionFactory implements OSQLFunctionFactory {
  @Override
  public boolean hasFunction(final String iName) {
    final ODatabaseRecord db = ODatabaseRecordThreadLocal.INSTANCE.get();
    return db.getMetadata().getFunctionLibrary().getFunction(iName) != null;
  }
View Full Code Here

    return db.getMetadata().getFunctionLibrary().getFunction(iName) != null;
  }

  @Override
  public Set<String> getFunctionNames() {
    final ODatabaseRecord db = ODatabaseRecordThreadLocal.INSTANCE.get();
    return db.getMetadata().getFunctionLibrary().getFunctionNames();
  }
View Full Code Here

    return db.getMetadata().getFunctionLibrary().getFunctionNames();
  }

  @Override
  public OSQLFunction createFunction(final String name) throws OCommandExecutionException {
    final ODatabaseRecord db = ODatabaseRecordThreadLocal.INSTANCE.get();
    final OFunction f = db.getMetadata().getFunctionLibrary().getFunction(name);
    return new ODatabaseFunction(f);
  }
View Full Code Here

  public void onRecordAfterDelete(final ODocument iDocument) {
    reloadLibrary();
  }

  protected void reloadLibrary() {
    final ODatabaseRecord db = ODatabaseRecordThreadLocal.INSTANCE.get();
    db.getMetadata().getFunctionLibrary().load();
  }
View Full Code Here

    return this;
  }

  @Override
  public Object execute(Map<Object, Object> iArgs) {
    final ODatabaseRecord database = getDatabase();
    if (database.hide(recordIdToHide))
      return 1;

    return 0;
  }
View Full Code Here

   */
  public Object execute(final Map<Object, Object> iArgs) {
    if (name == null)
      throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");

    final ODatabaseRecord database = getDatabase();
    if (name.equals("*")) {
      long totalIndexed = 0;
      for (OIndex<?> idx : database.getMetadata().getIndexManager().getIndexes()) {
        if (idx.isAutomatic())
          totalIndexed += idx.rebuild();
      }

      return totalIndexed;

    } else {
      final OIndex<?> idx = database.getMetadata().getIndexManager().getIndex(name);
      if (idx == null)
        throw new OCommandExecutionException("Index '" + name + "' not found");

      if (!idx.isAutomatic())
        throw new OCommandExecutionException("Cannot rebuild index '" + name
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.db.record.ODatabaseRecord

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.