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

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


                if (linkType != null)
                  if (linkType == OType.LINKSET) {
                    value = new ORecordLazySet(target);
                    ((Set<OIdentifiable>) value).add(doc);
                  } else if (linkType == OType.LINKLIST) {
                    value = new ORecordLazyList(target);
                    ((ORecordLazyList) value).add(doc);
                  } else
                    // IGNORE THE TYPE, SET IT AS LINK
                    value = doc;
                else
View Full Code Here


      break;
    case LINKSET:
      value = readLinkCollection(bytes, new ORecordLazySet(document));
      break;
    case LINKLIST:
      value = readLinkCollection(bytes, new ORecordLazyList(document));
      break;
    case BINARY:
      value = readBinary(bytes);
      break;
    case LINK:
View Full Code Here

      return bag;
    } else if (iType == OType.LINKSET) {
      return getValueAsLinkedCollection(new ORecordLazySet(iRecord), iRecord, iFieldValue, iType, iLinkedType, iFieldTypes, iNoMap,
          iOptions);
    } else if (iType == OType.LINKLIST) {
      return getValueAsLinkedCollection(new ORecordLazyList(iRecord), iRecord, iFieldValue, iType, iLinkedType, iFieldTypes,
          iNoMap, iOptions);
    } else if (iType == OType.EMBEDDEDSET) {
      return getValueAsEmbeddedCollection(new OTrackedSet<Object>(iRecord), iRecord, iFieldValue, iType, iLinkedType, iFieldTypes,
          iNoMap, iOptions);
    } else {
View Full Code Here

      if (isToSerialize(firstValue.getClass()))
        result = new ArrayList<Object>();
      else if ((iRecord != null && iType.equals(OType.EMBEDDEDLIST)) || OType.isSimpleType(firstValue))
        result = new OTrackedList<Object>(iRecord);
      else
        result = new ORecordLazyList(iRecord);
    }

    if (iType.equals(OType.LINKLIST) || iType.equals(OType.LINKSET) || iType.equals(OType.LINKMAP))
      linkedType = OType.LINK;
    else if (iType.equals(OType.EMBEDDEDLIST) || iType.equals(OType.EMBEDDEDSET) || iType.equals(OType.EMBEDDEDMAP))
View Full Code Here

      boolean embedded = OObjectEntitySerializer.isEmbeddedField(self.getClass(), f.getName());
      if (value instanceof List) {
        OType type = embedded ? OType.EMBEDDEDLIST : OType.LINKLIST;
        List<OIdentifiable> docList = doc.field(f.getName(), type);
        if (docList == null) {
          docList = new ORecordLazyList(doc);
          setDocFieldValue(f.getName(), docList, type);
        } else if (isFieldUpdate) {
          docList.clear();
        }
        value = new OObjectLazyList(self, docList, value,
View Full Code Here

    assertEquals(OType.EMBEDDEDMAP, OType.getTypeByValue(new HashMap<Object, Object>()));

    assertEquals(OType.LINKSET, OType.getTypeByValue(new ORecordLazySet(new ODocument())));

    assertEquals(OType.LINKLIST, OType.getTypeByValue(new ORecordLazyList(new ODocument())));

    assertEquals(OType.LINKMAP, OType.getTypeByValue(new ORecordLazyMap(new ODocument())));

    assertEquals(OType.LINKBAG, OType.getTypeByValue(new ORidBag()));
View Full Code Here

      if (iGraph.isAutoScaleEdgeType()
          && (prop == null || propType == OType.LINK || "true".equalsIgnoreCase(prop.getCustom("ordered")))) {
        // CREATE ONLY ONE LINK
        out = iTo;
      } else if (propType == OType.LINKLIST || (prop != null && "true".equalsIgnoreCase(prop.getCustom("ordered")))) {
        final Collection coll = new ORecordLazyList(iFromVertex);
        coll.add(iTo);
        out = coll;
      } else if (propType == null || propType == OType.LINKBAG) {
        final ORidBag bag = new ORidBag();
        bag.add(iTo);
        out = bag;
      } else
        throw new IllegalStateException("Type of field provided in schema '" + prop.getType()
            + " can not be used for link creation.");

    } else if (found instanceof OIdentifiable) {
      if (prop != null && propType == OType.LINK)
        throw new IllegalStateException("Type of field provided in schema '" + prop.getType()
            + " can not be used for creation to hold several links.");

      if (prop != null && "true".equalsIgnoreCase(prop.getCustom("ordered"))) {
        final Collection coll = new ORecordLazyList(iFromVertex);
        coll.add(found);
        coll.add(iTo);
        out = coll;
      } else {
        final ORidBag bag = new ORidBag();
        bag.add((OIdentifiable) found);
        bag.add(iTo);
View Full Code Here

TOP

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

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.