company logo

Property :: insertObject - Insert object

The function provides a fast way for building an object collection. The function only adds the instances to the collection index by object identity and key value without checking the instance data type. The application is responsible to pass objects for proper instances. Otherwise, reading instances from the collection later might result in a type conflict. In order to avoid type conflicts, the collection might be defined as VOID collection.

Maximum one access key (sort order) can be defined for the collection. When an access key is selected for the collection, a key value must be passed. For unordered collections, new instances are appended at the end of the collection.

The function can be used for adding instances to collections, only, which are not instance owner and which do not have inverse relationship or base collections. There function is typically used for creating transient or temporary collections.

Return value:  Property reference ( odaba::Property & )

A property handle refers to a (usually) opened property. Invalid properties may cause an exception.

Implementation overview

Implementation details

  1. Insert object by instance passed in property
    odaba::Property & Property  :: insertObject ( int64 iObjectID, odaba::Key vSortKey )

    The function only adds an instance to the collection index using the object identity of the instance selected in the property passed in cProperty.

    When the instance is ordered, the key value is extracted from the passed instance.

    When no instnace is selected in the passed property handle, the function throws an exception.

    • iObjectID - Local instance identity

      The object or instance identity is a unique identity within a database.

    • vSortKey - Access key

      The sort or access key value is provided as typed string in ESDF or CSV format. Key components can be separated by '|' or ';'.

      // key: name;first_name

      Miller;Paul          // simple positioned CSV key

      "Miller";"Paul Mary" // special characters must be quoted

  2. to list
  3. Insert object by instance passed in property
    odaba::Property & Property  :: insertObject ( odaba::Property &cProperty )

    The function only adds an instance to the collection index using the object identity of the instance selected in the property passed in cProperty.

    When the instance is ordered, the key value is extracted from the passed instance.

    When no instnace is selected in the passed property handle, the function throws an exception.

    • cProperty - Property reference

      A property handle refers to a (usually) opened property. Invalid properties may cause an exception.

  4. to list