I was reviewing examples of PL / SQL and applied generally use keys with fields sequences and not from table base fields.

Not if it's something special in APEX or if it's okay to use as a base table field keys. Why try to make a simple example form master / detail this turned complicated. Especially when I have to assign the key to the field of the detail table (autogenerated). I don't know how do it.