Examples of ORecordLazySet


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

    try {
      final ONavigableMap<Object, Set<OIdentifiable>> subSet = map.subMap(iRangeFrom, iInclusive, iRangeTo, iInclusive);
      if (subSet == null)
        return ORecordLazySet.EMPTY_SET;

      final Set<OIdentifiable> result = new ORecordLazySet(configuration.getDatabase());
      for (Set<OIdentifiable> v : subSet.values()) {
        result.addAll(v);
      }

      return result;

    } finally {
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

      if (!(iValue instanceof Set)) {
        // CONVERT IT TO SET
        final Collection<?> newValue;

        if (iValue instanceof ORecordLazyList || iValue instanceof ORecordLazyMap)
          newValue = new ORecordLazySet(this);
        else
          newValue = new OTrackedSet<Object>(this);

        if (iValue instanceof Collection<?>) {
          ((Collection<Object>) newValue).addAll((Collection<Object>) iValue);
View Full Code Here

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

      checkForKeyType(iKey);
     
      Set<OIdentifiable> values = map.get(iKey);
      checkForOptimization();
      if (values == null)
        values = new ORecordLazySet(configuration.getDatabase());

      if (!iSingleValue.getIdentity().isValid())
        ((ORecord<?>) iSingleValue).save();

      values.add(iSingleValue);
View Full Code Here

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 if (values.size() == 1) {
        // CHECK IF THE ID IS THE SAME OF CURRENT: THIS IS THE UPDATE CASE
        if (!values.contains(iSingleValue))
          throw new OIndexException("Found duplicated key '" + iKey + "' on unique index '" + name + "' for record "
              + iSingleValue.getIdentity() + ". The record already present in the index is "
View Full Code Here

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

        // SEARCH FOR THE WORD
        refs = map.get(word);
        checkForOptimization();
        if (refs == null)
          // WORD NOT EXISTS: CREATE THE KEYWORD CONTAINER THE FIRST TIME THE WORD IS FOUND
          refs = new ORecordLazySet(configuration.getDatabase());

        // ADD THE CURRENT DOCUMENT AS REF FOR THAT WORD
        refs.add(iSingleValue);

        // SAVE THE INDEX ENTRY
View Full Code Here

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

  public Set<OIdentifiable> get(final Object iKey) {
    checkForOptimization();
    acquireExclusiveLock();
    try {

      final ORecordLazySet values = (ORecordLazySet) map.get(iKey);
      if (values != null)
        values.setDatabase(ODatabaseRecordThreadLocal.INSTANCE.get());

      if (values == null)
        return ORecordLazySet.EMPTY_SET;

      return values;
View Full Code Here

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

    try {
      final ONavigableMap<Object, Set<OIdentifiable>> subSet = map.tailMap(fromKey, isInclusive);
      if (subSet == null)
        return ORecordLazySet.EMPTY_SET;

      final Set<OIdentifiable> result = new ORecordLazySet(configuration.getDatabase());
      for (Set<OIdentifiable> v : subSet.values()) {
        result.addAll(v);
      }

      return result;
    } finally {
      releaseExclusiveLock();
View Full Code Here

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

    try {
      final ONavigableMap<Object, Set<OIdentifiable>> subSet = map.headMap(toKey, isInclusive);
      if (subSet == null)
        return ORecordLazySet.EMPTY_SET;

      final Set<OIdentifiable> result = new ORecordLazySet(configuration.getDatabase());
      for (Set<OIdentifiable> v : subSet.values()) {
        result.addAll(v);
      }

      return result;
    } finally {
      releaseExclusiveLock();
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.