Examples of ORecordLazySet


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

      Set<OIdentifiable> values = map.get(iKey);
      checkForOptimization();

      if (values == null)
        values = new ORecordLazySet(configuration.getDatabase());
      else
        values.clear();

      values.add(iSingleValue);
View Full Code Here

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

    } else if (iFieldValue.startsWith("[") && iFieldValue.endsWith("]")) {

      // EMBEDDED VALUES
      final Collection<?> embeddedCollection;
      if (iType == OType.LINKSET)
        embeddedCollection = new ORecordLazySet(iRecord);
      else if (iType == OType.EMBEDDEDSET)
        embeddedCollection = new OTrackedSet<Object>(iRecord);
      else if (iType == OType.LINKLIST)
        embeddedCollection = new ORecordLazyList(iRecord);
      else
View Full Code Here

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

      // REMOVE BEGIN & END COLLECTIONS CHARACTERS IF IT'S A COLLECTION
      final String value = iValue.startsWith("[") ? iValue.substring(1, iValue.length() - 1) : iValue;

      return iType == OType.LINKLIST ? new ORecordLazyList(iSourceRecord).setStreamedContent(new StringBuilder(value))
          : new ORecordLazySet(iSourceRecord).setStreamedContent(new StringBuilder(value));
    }

    case LINKMAP: {
      if (iValue.length() == 0)
        return null;
View Full Code Here

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

      OProfiler.getInstance().stopChrono("serializer.rec.str.linkList2string", timer);
      break;
    }

    case LINKSET: {
      final ORecordLazySet coll;

      if (!(iValue instanceof ORecordLazySet)) {
        // FIRST TIME: CONVERT THE ENTIRE COLLECTION
        coll = new ORecordLazySet(iRecord);
        coll.addAll((Collection<? extends OIdentifiable>) iValue);
        ((Collection<? extends OIdentifiable>) iValue).clear();

        iRecord.field(iName, coll);
      } else
        // LAZY SET
View Full Code Here

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

      final ODocument edge = new ODocument(this, iClassName != null ? iClassName : EDGE_CLASS_NAME).setOrdered(true);
      edge.field(EDGE_FIELD_OUT, iOutVertex);
      edge.field(EDGE_FIELD_IN, iInVertex);

      ORecordLazySet out = ((ORecordLazySet) iOutVertex.field(VERTEX_FIELD_OUT));
      if (out == null) {
        out = new ORecordLazySet(iOutVertex);
        iOutVertex.field(VERTEX_FIELD_OUT, out);
      }
      out.add(edge);

      ORecordLazySet in = ((ORecordLazySet) iInVertex.field(VERTEX_FIELD_IN));
      if (in == null) {
        in = new ORecordLazySet(iInVertex);
        iInVertex.field(VERTEX_FIELD_IN, in);
      }
      in.add(edge);

      if (safeMode) {
        save(edge);
        commitBlock(safeMode);
      }
View Full Code Here

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

   * @return
   */
  public Set<OIdentifiable> getOutEdges(final ODocument iVertex, final String iLabel) {
    checkVertexClass(iVertex);

    final ORecordLazySet set = iVertex.field(VERTEX_FIELD_OUT);

    if (iLabel == null)
      // RETURN THE ENTIRE COLLECTION
      if (set != null)
        return Collections.unmodifiableSet(set);
      else
        return Collections.emptySet();

    // FILTER BY LABEL
    final ORecordLazySet result = new ORecordLazySet(underlying);
    if (set != null)
      for (OIdentifiable item : set) {
        if (iLabel == null || iLabel.equals(((ODocument) item).field(LABEL)))
          result.add(item);
      }

    return result;
  }
View Full Code Here

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

  }

  public Set<OIdentifiable> getInEdges(final ODocument iVertex, final String iLabel) {
    checkVertexClass(iVertex);

    final ORecordLazySet set = iVertex.field(VERTEX_FIELD_IN);

    if (iLabel == null)
      // RETURN THE ENTIRE COLLECTION
      if (set != null)
        return Collections.unmodifiableSet(set);
      else
        return Collections.emptySet();

    // FILTER BY LABEL
    final ORecordLazySet result = new ORecordLazySet(underlying);
    if (set != null)
      for (OIdentifiable item : set) {
        if (iLabel == null || iLabel.equals(((ODocument) item).field(LABEL)))
          result.add(item);
      }

    return result;
  }
View Full Code Here

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

        return Collections.unmodifiableSet(iEdges);
      else
        return Collections.emptySet();

    // FILTER BY PROPERTY VALUES
    final ORecordLazySet result = new ORecordLazySet(underlying);
    if (iEdges != null)
      for (OIdentifiable item : iEdges) {
        final ODocument doc = (ODocument) item;
        for (String propName : iPropertyNames) {
          if (doc.containsField(propName))
            // FOUND: ADD IT
            result.add(item);
        }
      }

    return result;
  }
View Full Code Here

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

        return Collections.unmodifiableSet(iEdges);
      else
        return Collections.emptySet();

    // FILTER BY PROPERTY VALUES
    final ORecordLazySet result = new ORecordLazySet(underlying);
    if (iEdges != null)
      for (OIdentifiable item : iEdges) {
        final ODocument doc = (ODocument) item;
        for (Entry<String, Object> prop : iProperties.entrySet()) {
          if (prop.getKey() != null && doc.containsField(prop.getKey())) {
            if (prop.getValue() == null) {
              if (doc.field(prop.getKey()) == null)
                // BOTH NULL: ADD IT
                result.add(item);
            } else if (prop.getValue().equals(doc.field(prop.getKey())))
              // SAME VALUE: ADD IT
              result.add(item);
          }
        }
      }

    return result;
View Full Code Here

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

    } else if (iFieldValue.startsWith("[") && iFieldValue.endsWith("]")) {

      // EMBEDDED VALUES
      final Collection<?> embeddedCollection;
      if (iType == OType.LINKSET)
        embeddedCollection = new ORecordLazySet(iRecord);
      else if (iType == OType.EMBEDDEDSET)
        embeddedCollection = new OTrackedSet<Object>(iRecord);
      else if (iType == OType.LINKLIST)
        embeddedCollection = new ORecordLazyList(iRecord);
      else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.