Package com.orientechnologies.orient.core.record

Examples of com.orientechnologies.orient.core.record.ORecord


       } finally {
         endResponse();
       }

     } else {
       final ORecord record = connection.database.load(rid, fetchPlanString, ignoreCache, loadTombstones,
           OStorage.LOCKING_STRATEGY.DEFAULT);

       beginResponse();
       try {
         sendOk(clientTxId);

         if (record != null) {
           channel.writeByte((byte) 1); // HAS RECORD
           channel.writeBytes(getRecordBytes(record));
           channel.writeVersion(record.getRecordVersion());
           channel.writeByte(ORecordInternal.getRecordType(record));

           if (fetchPlanString.length() > 0) {
             // BUILD THE SERVER SIDE RECORD TO ACCES TO THE FETCH
             // PLAN
View Full Code Here


  }

  protected boolean fixLink(final Object fieldValue) {
    if (fieldValue instanceof OIdentifiable) {
      if (((OIdentifiable) fieldValue).getIdentity().isValid()) {
        final ORecord connected = ((OIdentifiable) fieldValue).getRecord();
        if (connected == null)
          return true;
      }
    }
    return false;
View Full Code Here

    final Map<OIdentifiable, Change> newChangedValues = new HashMap<OIdentifiable, Change>();
    for (Map.Entry<OIdentifiable, Change> entry : changes.entrySet()) {
      OIdentifiable identifiable = entry.getKey();
      if (identifiable instanceof ORecord) {
        ORID identity = identifiable.getIdentity();
        ORecord record = (ORecord) identifiable;
        if (identity.isNew() || record.isDirty()) {
          record.save();
          identity = record.getIdentity();
        }

        newChangedValues.put(identity, entry.getValue());
      } else
        newChangedValues.put(entry.getKey().getIdentity(), entry.getValue());
    }

    for (Map.Entry<OIdentifiable, Change> entry : newChangedValues.entrySet()) {
      if (entry.getKey() instanceof ORecord) {
        ORecord record = (ORecord) entry.getKey();
        record.save();

        newChangedValues.put(record, entry.getValue());
      } else
        return false;
    }
View Full Code Here

  @Override
  public int serialize(byte[] stream, int offset, UUID ownerUuid) {
    for (OIdentifiable identifiable : changes.keySet()) {
      if (identifiable instanceof ORecord) {
        final ORID identity = identifiable.getIdentity();
        final ORecord record = (ORecord) identifiable;
        if (identity.isNew() || record.isDirty()) {
          record.save();
        }
      }
    }

    for (Map.Entry<OIdentifiable, OModifiableInteger> entry : newEntries.entrySet()) {
View Full Code Here

   public abstract boolean isEmpty();

   protected void fetchRecord(final Object iRecord, final OFetchListener iFetchListener) {
     if (fetchPlan != null && iRecord instanceof ORecord) {
       final ORecord record = (ORecord) iRecord;
       final OFetchContext context = new ORemoteFetchContext();
       OFetchHelper.fetch(record, record, fetchPlan, iFetchListener, context, "");
     }
   }
View Full Code Here

      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();
          }

          entries[i] = record.getIdentity();
        }
      }
    }

    return true;
View Full Code Here

      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

           // BROWSE ALL THE RECORD TO HAVE THE COMPLETE COLUMN
           // NAMES LIST
           while (it.hasNext()) {
             final Object r = it.next();
             if (r != null && r instanceof OIdentifiable) {
               final ORecord rec = ((OIdentifiable) r).getRecord();
               if (rec != null) {
                 if (rec instanceof ODocument) {
                   final ODocument doc = (ODocument) rec;
                   records.add(doc);
View Full Code Here

         if (entry != null) {
           if (counter++ > 0)
             buffer.append(", ");

           if (entry instanceof OIdentifiable) {
             ORecord rec = ((OIdentifiable) entry).getRecord();
             if (rec != null)
               try {
                 objectJson = rec.toJSON(format);

                 buffer.append(objectJson);
               } catch (Exception e) {
                 OLogManager.instance().error(this, "Error transforming record " + rec.getIdentity() + " to JSON", e);
               }
           } else if (OMultiValue.isMultiValue(entry))
             formatMultiValue(OMultiValue.getMultiValueIterator(entry), buffer, format);
           else
             buffer.append(OJSONWriter.writeValue(entry, format));
View Full Code Here

    while (target.hasNext()) {
      value = target.next();
      index++;

      if (value instanceof OIdentifiable) {
        final ORecord rec = ((OIdentifiable) value).getRecord();

        if (rec instanceof ODocument) {
          final OTraverseAbstractProcess<ODocument> subProcess = new OTraverseRecordProcess(command, (ODocument) rec, getPath());
          command.getContext().push(subProcess);
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.record.ORecord

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.