SetReference

SetReference(zugriffsAusdruck), SetReference(zugriffsAusdruck, backRef), SetReference(STACK, STACK)

Parameter:  Access Path, back reference name.

Stack
Stack Position Description
Stack(In) top target object
  top-1 referenced object
Stack(Out) top -

Attention!
outdated, please use link

After the operation, the pointer p, which is accessed via access path coming from the target object  access path, shall point at the stack top 1 object. If the pointer, that has been selected in the target object, is declared as a 1-1- or 1-m reference in the DDI, it requires to indicate a back reference name as the second operand.

setreference.bmp (665670 Byte)

If p != ZERO (before the operation), the currently valid back reference will be caused at first. Then, p and the (new) back reference (pointer or collection) will be set. SetReference is controlled by DDI entries and is cancelled with an error, when trying to generate a reference, which does not comply with the DDI definitions. This is the case, 

A persistent object shall never reference a transient object. This refers to reference and back reference. The following references are allowed:

  transient persistent
transient allowed allowed within limitations
persistent forbidden allowed

A transient object can reference a persistent one, if

Information:  Whenever a persistent object takes part in this operation, a transaction will start.