java.lang.Object
com.orientechnologies.orient.core.db.record.ridbag.ORidBag
All Implemented Interfaces:
OCollection<OIdentifiable>, OSizeable, OAutoConvertToRecord, ODetachable, ORecordElement, ORecordLazyMultiValue, OTrackedMultiValue<OIdentifiable,OIdentifiable>, OStringBuilderSerializable, Iterable<OIdentifiable>

A collection that contain links to OIdentifiable. Bag is similar to set but can contain several entering of the same object.

Could be tree based and embedded representation.

  • Embedded stores its content directly to the document that owns it.
    It better fits for cases when only small amount of links are stored to the bag.
  • Tree-based implementation stores its content in a separate data structure called OSBTreeBonsai.
    It fits great for cases when you have a huge amount of links.

The representation is automatically converted to tree-based implementation when top threshold is reached. And backward to embedded one when size is decreased to bottom threshold.
The thresholds could be configured by OGlobalConfiguration.RID_BAG_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD and OGlobalConfiguration.RID_BAG_SBTREEBONSAI_TO_EMBEDDED_THRESHOLD.

This collection is used to efficiently manage relationships in graph model.

Does not implement Collection interface because some operations could not be efficiently implemented and that's why should be avoided.
Since:
1.7rc1
Author:
Artem Orobets (enisher-at-gmail.com), Andrey Lomakin (a.lomakin-at-orientdb.com)