Package com.orientechnologies.orient.core.id

Examples of com.orientechnologies.orient.core.id.ORecordId


    if (contentType == MULTIVALUE_CONTENT_TYPE.ALL_RECORDS && !o.getIdentity().isNew())
      // ALL RECORDS AND THE OBJECT IS NOT NEW, DO NOTHING
      return;

    if (o != null && o instanceof ORecordId) {
      final ORecordId rid = (ORecordId) o;

      marshalling = true;
      try {
        final ORecordInternal<?> record = database.load(rid);
View Full Code Here


    for (String item : items) {
      if (item.length() == 0)
        continue;

      super.rawAdd(new ORecordId(item));
    }

    modCount = currentModCount;
    marshalling = false;
View Full Code Here

        result = new Object[] { l, getDate(iRecord, r) };
      }

      // RIDS
      else if (r instanceof ORID && l instanceof String && !l.equals(OSQLHelper.NOT_NULL)) {
        result = new Object[] { new ORecordId((String) l), r };
      } else if (l instanceof ORID && r instanceof String && !r.equals(OSQLHelper.NOT_NULL)) {
        result = new Object[] { l, new ORecordId((String) r) };
      }

    return result;
  }
View Full Code Here

    if (records.isEmpty())
      throw new OCommandExecutionException("Can't execute the command because it hasn't been parsed yet");

    for (String rec : records) {
      try {
        final ORecordId rid = new ORecordId(rec);
        database.getStorage().deleteRecord(rid, -1);
      } catch (Throwable e) {
        throw new OCommandExecutionException("Error on executing command", e);
      }
    }
View Full Code Here

            if (ioResult != null) {

              ODocument record;
              if (ioResult instanceof String) {
                try {
                  record = new ODocument(iDatabase, new ORecordId((String) ioResult));
                } catch (Exception e) {
                  OLogManager.instance().error(this, "Error on reading rid with value '%s'", null, ioResult);
                  record = null;
                }
              } else if (ioResult instanceof ORID)
View Full Code Here

      throw new OCommandSQLParsingException(
          "Range must contains the keyword 'first', 'last' or a valid record id in the form of <cluster-id>:<cluster-pos>. Example: RANGE 10:50, last",
          text, currentPos);

    try {
      return new ORecordId(iRangeBound);
    } catch (Exception e) {
      throw new OCommandSQLParsingException("Invalid record id setted as RANGE to. Value setted is '" + iRangeBound
          + "' but it should be a valid record id in the form of <cluster-id>:<cluster-pos>. Example: 10:50", text, currentPos);
    }
  }
View Full Code Here

    return currentPos;
  }

  private void scanEntireClusters(final int[] clusterIds) {
    final ORecordId realRangeFrom = getRealRange(clusterIds, rangeFrom);
    final ORecordId realRangeTo = getRealRange(clusterIds, rangeTo);

    ((OStorageEmbedded) database.getStorage()).browse(clusterIds, realRangeFrom, realRangeTo, this,
        (ORecordInternal<?>) database.newInstance(), false);
  }
View Full Code Here

  }

  private ORecordId getRealRange(final int[] clusterIds, final ORecordId iRange) {
    if (iRange == FIRST)
      // COMPUTE THE REAL RANGE BASED ON CLUSTERS: GET THE FIRST POSITION
      return new ORecordId(clusterIds[0], 0);
    else if (iRange == LAST)
      // COMPUTE THE REAL RANGE BASED ON CLUSTERS: GET LATEST POSITION
      return new ORecordId(clusterIds[clusterIds.length - 1], -1);
    return iRange;
  }
View Full Code Here

    scanEntireClusters(clusterIds);
  }

  private void searchInRecords() {
    ORecordId rid = new ORecordId();
    ORecordInternal<?> record;
    for (String rec : compiledFilter.getTargetRecords()) {
      rid.fromString(rec);
      record = database.load(rid);
      foreach(record);
    }
  }
View Full Code Here

  public OSerializableStream fromStream(final byte[] iStream) throws OSerializationException {
    final OMemoryInputStream buffer = new OMemoryInputStream(iStream);
    try {
      text = buffer.getAsString();
      limit = buffer.getAsInteger();
      beginRange = new ORecordId().fromStream(buffer.getAsByteArrayFixed(ORecordId.PERSISTENT_SIZE));
      endRange = new ORecordId().fromStream(buffer.getAsByteArrayFixed(ORecordId.PERSISTENT_SIZE));
      setFetchPlan(buffer.getAsString());

      byte[] paramBuffer = buffer.getAsByteArray();

      if (paramBuffer.length == 0)
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.id.ORecordId

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.