Examples of ORecordLazyMap


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

      } else if (fieldValue instanceof Set<?>) {
        iCloned._fieldValues.put(iEntry.getKey(), new HashSet<Object>((Set<Object>) fieldValue));

        // MAPS
      } else if (fieldValue instanceof ORecordLazyMap) {
        final ORecordLazyMap newMap = new ORecordLazyMap(iCloned, ((ORecordLazyMap) fieldValue).getRecordType());
        newMap.putAll((ORecordLazyMap) fieldValue);
        iCloned._fieldValues.put(iEntry.getKey(), newMap);

      } else if (fieldValue instanceof OTrackedMap) {
        final OTrackedMap<Object> newMap = new OTrackedMap<Object>(iCloned);
        newMap.putAll((OTrackedMap<Object>) fieldValue);
        iCloned._fieldValues.put(iEntry.getKey(), newMap);

      } else if (fieldValue instanceof Map<?, ?>) {
        iCloned._fieldValues.put(iEntry.getKey(), new LinkedHashMap<String, Object>((Map<String, Object>) fieldValue));
      } else
View Full Code Here

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

      // REMOVE BEGIN & END MAP CHARACTERS
      String value = iValue.substring(1, iValue.length() - 1);

      @SuppressWarnings("rawtypes")
      final Map map = new ORecordLazyMap(iSourceRecord, ODocument.RECORD_TYPE);

      if (value.length() == 0)
        return map;

      final List<String> items = OStringSerializerHelper.smartSplit(value, OStringSerializerHelper.RECORD_SEPARATOR);

      // EMBEDDED LITERALS
      for (String item : items) {
        if (item != null && item.length() > 0) {
          final List<String> entry = OStringSerializerHelper.smartSplit(item, OStringSerializerHelper.ENTRY_SEPARATOR);
          if (entry.size() > 0) {
            String mapValue = entry.get(1);
            if (mapValue != null && mapValue.length() > 0)
              mapValue = mapValue.substring(1);
            map.put(fieldTypeFromStream((ODocument) iSourceRecord, OType.STRING, entry.get(0)), new ORecordId(mapValue));
          }

        }
      }
      return map;
View Full Code Here

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

    String value = iValue.substring(1, iValue.length() - 1);

    @SuppressWarnings("rawtypes")
    Map map;
    if (iLinkedType == OType.LINK || iLinkedType == OType.EMBEDDED)
      map = new ORecordLazyMap(iSourceDocument, ODocument.RECORD_TYPE);
    else
      map = new OTrackedMap<Object>(iSourceDocument);

    if (value.length() == 0)
      return map;

    final List<String> items = OStringSerializerHelper.smartSplit(value, OStringSerializerHelper.RECORD_SEPARATOR);

    // EMBEDDED LITERALS

    if (map instanceof ORecordElement)
      ((ORecordElement) map).setInternalStatus(STATUS.UNMARSHALLING);

    for (String item : items) {
      if (item != null && item.length() > 0) {
        final List<String> entry = OStringSerializerHelper.smartSplit(item, OStringSerializerHelper.ENTRY_SEPARATOR);
        if (entry.size() > 0) {
          String mapValue = entry.get(1);

          if (iLinkedType == null)
            if (mapValue.length() > 0) {
              iLinkedType = getType(mapValue);
              if (iLinkedType == OType.LINK && !(map instanceof ORecordLazyMap)) {
                // CONVERT IT TO A LAZY MAP
                map = new ORecordLazyMap(iSourceDocument, ODocument.RECORD_TYPE);
                ((ORecordElement) map).setInternalStatus(STATUS.UNMARSHALLING);
              }
            } else
              iLinkedType = OType.EMBEDDED;
View Full Code Here

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

          ((OLazyObjectMap<?>) map).setConvertToRecord(true);
        }
      }

      if (invalidMap) {
        final ORecordLazyMap newMap = new ORecordLazyMap(iRecord, ODocument.RECORD_TYPE);

        // REPLACE ALL CHANGED ITEMS
        for (Map.Entry<String, Object> entry : map.entrySet()) {
          newMap.put(entry.getKey(), (OIdentifiable) entry.getValue());
        }
        map.clear();
        iRecord.field(iName, newMap);
      }
View Full Code Here

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

      } else if (fieldValue instanceof Set<?>) {
        cloned._fieldValues.put(entry.getKey(), new HashSet<Object>((Set<Object>) fieldValue));

        // MAPS
      } else if (fieldValue instanceof ORecordLazyMap) {
        final ORecordLazyMap newMap = new ORecordLazyMap(cloned, ((ORecordLazyMap) fieldValue).getRecordType());
        newMap.putAll((ORecordLazyMap) fieldValue);
        cloned._fieldValues.put(entry.getKey(), newMap);

      } else if (fieldValue instanceof OTrackedMap) {
        final OTrackedMap<Object> newMap = new OTrackedMap<Object>(cloned);
        newMap.putAll((OTrackedMap<Object>) fieldValue);
        cloned._fieldValues.put(entry.getKey(), newMap);

      } else if (fieldValue instanceof Map<?, ?>) {
        cloned._fieldValues.put(entry.getKey(), new LinkedHashMap<String, Object>((Map<String, Object>) fieldValue));
      } else
View Full Code Here

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

      // REMOVE BEGIN & END MAP CHARACTERS
      String value = iValue.substring(1, iValue.length() - 1);

      @SuppressWarnings("rawtypes")
      final Map map = new ORecordLazyMap(iSourceRecord, ODocument.RECORD_TYPE);

      if (value.length() == 0)
        return map;

      final List<String> items = OStringSerializerHelper.smartSplit(value, OStringSerializerHelper.RECORD_SEPARATOR);

      // EMBEDDED LITERALS
      List<String> entry;
      String mapValue;

      for (String item : items) {
        if (item != null && item.length() > 0) {
          entry = OStringSerializerHelper.smartSplit(item, OStringSerializerHelper.ENTRY_SEPARATOR);
          if (entry.size() > 0) {
            mapValue = entry.get(1);
            if (mapValue != null && mapValue.length() > 0)
              mapValue.substring(1);
            map.put(fieldTypeFromStream((ODocument) iSourceRecord, OType.STRING, entry.get(0)), new ORecordId(mapValue));
          }

        }
      }
      return map;
View Full Code Here

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

    String value = iValue.substring(1, iValue.length() - 1);

    @SuppressWarnings("rawtypes")
    final Map map;
    if (iLinkedType == OType.LINK || iLinkedType == OType.EMBEDDED)
      map = new ORecordLazyMap(iSourceDocument, ODocument.RECORD_TYPE);
    else
      map = new OTrackedMap<Object>(iSourceDocument);

    if (value.length() == 0)
      return map;
View Full Code Here

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

          ((OLazyObjectMap<?>) map).setConvertToRecord(true);
        }
      }

      if (invalidMap) {
        final ORecordLazyMap newMap = new ORecordLazyMap(iRecord, ODocument.RECORD_TYPE);

        // REPLACE ALL CHANGED ITEMS
        for (Map.Entry<String, Object> entry : map.entrySet()) {
          newMap.put(entry.getKey(), (OIdentifiable) entry.getValue());
        }
        map.clear();
        iRecord.field(iName, newMap);
      }
View Full Code Here

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

      // REMOVE BEGIN & END MAP CHARACTERS
      String value = iValue.substring(1, iValue.length() - 1);

      @SuppressWarnings("rawtypes")
      final Map map = new ORecordLazyMap(iSourceRecord, ODocument.RECORD_TYPE);

      if (value.length() == 0)
        return map;

      final List<String> items = OStringSerializerHelper.smartSplit(value, OStringSerializerHelper.RECORD_SEPARATOR);

      // EMBEDDED LITERALS
      List<String> entry;
      String mapValue;

      for (String item : items) {
        if (item != null && item.length() > 0) {
          entry = OStringSerializerHelper.smartSplit(item, OStringSerializerHelper.ENTRY_SEPARATOR);
          if (entry.size() > 0) {
            mapValue = entry.get(1);
            if (mapValue != null && mapValue.length() > 0)
              mapValue = mapValue.substring(1);
            map.put(fieldTypeFromStream((ODocument) iSourceRecord, OType.STRING, entry.get(0)), new ORecordId(mapValue));
          }

        }
      }
      return map;
View Full Code Here

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

    String value = iValue.substring(1, iValue.length() - 1);

    @SuppressWarnings("rawtypes")
    final Map map;
    if (iLinkedType == OType.LINK || iLinkedType == OType.EMBEDDED)
      map = new ORecordLazyMap(iSourceDocument, ODocument.RECORD_TYPE);
    else
      map = new OTrackedMap<Object>(iSourceDocument);

    if (value.length() == 0)
      return map;
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.