company logo

Property :: currentKey - Current key property

The current key concept differs slightly from the concept of primary or identifying key. Since data type for instances in weak-typed collections may change, the primary key definitions for those instances may change as well.

In contrast to the primaryKey() property, which refers to the primary key defined for the base type of the property, the currentKey() property refers to the primary key of the currently selected instance in the property.

For fixed typed properties the property is identical with the primaryKey() property.

Return value:  Current key value ( odaba::Key  )

The current key value is either the access key value, if the collection is ordered, or the primary key value if not.

Implementation overview

Implementation details

  1. Extract ident-key from the currently selected instance
    odaba::Key Property  :: currentKey (  )

    The function extracts the current key from the currently selected instance. When an instance is located in the property handle but no instance has been selected, the function will select the instance located before extracting the key value.

    When no instance could be selected, the function throws an exception.

  2. to list
  3. Set current key value
    odaba::Key Property  :: currentKey ( odaba::Key cCurrentKey )

    The passed key value is stored to the component attributes of the instance's primary key in the currently selected instance of the property handle.

    For fixed type collections, where the primary key of the instances is the same as the primary key of the property, the primaryKey() set function can be called, instead.

    When no instance is selected or when no primary key is defined for the structure the function throws an exception.

    • cCurrentKey - Current key value

      The current key value is either the access key value, if the collection is ordered, or the primary key value if not.

  4. to list