if you use Relationship many As obj [ Cardinality = many, Inverse = one ];
you create a managed pointer from many->one with no sequence of insert.
Though it may be kept if new "many" elements are inserted in sequence with ascending IDs.
Later (manual?) add to the relationship of already exisiting "many" may break this.
To bypass this limitation I see 2 possible solutions:
- you add a property (auto-incremented, insert sequencer) to "many" to keep the insert sequence
e.g. Property InsertSequence As %Integer [ InitialExpression = {$increment(^InSeq)} ];
which is rather brute force, but available to manual adjustment for existing data
- you add to "one" side: Property ManyList As %ListOfObjects;
and add your many with Insert() function at and the end of the individual list.
The advantage of this approach is to have the freedom to change the sequence at your needs
And it also allows a kind of m:n relation as you are not limited to add your many to a unique one.
This is not my preferred solution and requires some coding erfort.
- Log in to post comments
.png)
.png)