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

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


    if (!iterator.hasNext()) {
      iterator = null;
      return null;
    }

    final OIdentifiable value = iterator.next();
    return new Map.Entry<Object, OIdentifiable>() {
      @Override
      public Object getKey() {
        return key;
      }
View Full Code Here


    try {
      for (int i = 0; i < 10; i++)
        nullSBTree.put(i, new ORecordId(3, OClusterPositionFactory.INSTANCE.valueOf(i)));

      OIdentifiable identifiable = nullSBTree.get(null);
      Assert.assertNull(identifiable);

      nullSBTree.put(null, new ORecordId(10, OClusterPositionFactory.INSTANCE.valueOf(1000)));

      identifiable = nullSBTree.get(null);
      Assert.assertEquals(identifiable, new ORecordId(10, OClusterPositionFactory.INSTANCE.valueOf(1000)));

      OIdentifiable removed = nullSBTree.remove(5);
      Assert.assertEquals(removed, new ORecordId(3, OClusterPositionFactory.INSTANCE.valueOf(5)));

      removed = nullSBTree.remove(null);
      Assert.assertEquals(removed, new ORecordId(10, OClusterPositionFactory.INSTANCE.valueOf(1000)));
View Full Code Here

    for (int i = 0; i < entriesLength; i++) {
      final Object entry = entries[i];

      if (entry instanceof OIdentifiable) {
        final OIdentifiable identifiable = (OIdentifiable) entry;
        entries[i] = identifiable.getRecord();
      }
    }
  }
View Full Code Here

  public boolean convertRecords2Links() {
    for (int i = 0; i < entriesLength; i++) {
      final Object entry = entries[i];

      if (entry instanceof OIdentifiable) {
        final OIdentifiable identifiable = (OIdentifiable) entry;
        if (identifiable instanceof ORecord) {
          final ORecord record = (ORecord) identifiable;
          if (record.getIdentity().isNew()) {
            record.save();
          }
View Full Code Here

    if (size < 10) {
      final StringBuilder sb = new StringBuilder(256);
      sb.append('[');
      for (final Iterator<OIdentifiable> it = this.iterator(); it.hasNext();) {
        try {
          OIdentifiable e = it.next();
          sb.append(e.getIdentity());
          if (it.hasNext())
            sb.append(", ");
        } catch (NoSuchElementException ex) {
          // IGNORE THIS
        }
View Full Code Here

  public int serialize(byte[] stream, int offset, UUID ownerUuid) {
    for (int i = 0; i < entriesLength; i++) {
      final Object entry = entries[i];

      if (entry instanceof OIdentifiable) {
        final OIdentifiable identifiable = (OIdentifiable) entry;
        if (identifiable instanceof ORecord) {
          final ORecord record = (ORecord) identifiable;
          if (record.isDirty() || record.getIdentity().isNew()) {
            record.save();
          }
View Full Code Here

    for (int i = 0; i < entriesSize; i++) {
      ORID rid = OLinkSerializer.INSTANCE.deserialize(serializedContent, offset);
      offset += OLinkSerializer.RID_SIZE;

      OIdentifiable identifiable;
      if (rid.isTemporary())
        identifiable = rid.getRecord();
      else
        identifiable = rid;
View Full Code Here

      currentIndex = nextIndex;
      if (currentIndex == -1)
        throw new NoSuchElementException();

      final OIdentifiable nextValue = (OIdentifiable) entries[currentIndex];
      nextIndex = nextIndex();

      if (convertToRecord)
        return nextValue.getRecord();

      return nextValue;
    }
View Full Code Here

      if (currentIndex == -1)
        throw new IllegalStateException("Next method was not called for given iterator");

      currentRemoved = true;

      final OIdentifiable nextValue = (OIdentifiable) entries[currentIndex];
      entries[currentIndex] = Tombstone.TOMBSTONE;

      size--;
      contentWasChanged = true;
View Full Code Here

    ORecordId rid;
    if (iRecordId.indexOf(':') > -1)
      rid = new ORecordId(iRecordId);
    else {
      OIdentifiable rec = setCurrentRecord(Integer.parseInt(iRecordId));
      if (rec != null)
        rid = (ORecordId) rec.getIdentity();
      else
        return;
    }

    final ORawBuffer buffer = currentDatabase.getStorage()
View Full Code Here

TOP

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

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.