Examples of ORecordLazySet


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()).setRidOnly(true);

      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()).setRidOnly(true).setRidOnly(true);
      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()).setRidOnly(true);

        // 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

    if (iStream == null)
      return null;

    final String s = OBinaryProtocol.bytes2string(iStream);

    ORecordLazySet set = (ORecordLazySet) FORMAT.embeddedCollectionFromStream(iDatabase, null, OType.EMBEDDEDSET, null, OType.LINK, s);
    set.setRidOnly(true);
    return set;
  }
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

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

    final Collection<?> coll;
    if (iLinkedType == OType.LINK) {
      if (iDocument != null)
        coll = iType == OType.EMBEDDEDLIST ? new ORecordLazyList(iDocument).setStreamedContent(new StringBuilder(value))
            : new ORecordLazySet(iDocument).setStreamedContent(new StringBuilder(value));
      else
        coll = iType == OType.EMBEDDEDLIST ? new ORecordLazyList(iDatabase).setStreamedContent(new StringBuilder(value))
            : new ORecordLazySet(iDatabase).setStreamedContent(new StringBuilder(value));

      // LAZY LOADED: RETURN
      return coll;
    }
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
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.