company logo

owning - OWNER option

Collections (local collections or extents) can be marked as owning collections, which are considered as owner of the instances stored for the collection. In an ODABA database each instance has got exactly one owning collection, i.e. each instance has exactly one owner.

In general, references and root superset are owning collections, but one may also define owning relationships.

Owning collections must never get a base collection, while not owning collections should refer to a base collection, when creating instances is allowed for the collection.

Complex data types referenced in owning references or relationships must not contain shared base types.

Instances stored in owning collections should not refer to instances in not owning relationships. Exactly said, this means: when a complex data type being referenced in a local collection contains relationships with inverse references that have got a global (extent) root superset, the relationships can be accessed read-only. Trying to access those relationships in write mode will cause a warning written to the error log.

// the problem

  person: Car cars ownner // cars owned by the person

  Car: Company producer inverse produced // company producing the car)

  Company: Car produces inverse producer based_on Cars // extent

// this causes a conflict, since cars are owned by person but

// inverse referenced in company, which has got an extent superset Cars

Notes:

Owning collections are considered as unique collections, always. I.e. one cannot store instances twice in an owning collection.

Type: bit