package pt.ist.fenixframework.pstm; class PersistentRoot { String rootKey; } relation MultipleRoots { PersistentRoot playsRole previous; PersistentRoot playsRole next; } relation PersistentRootAbstractDomainObject { AbstractDomainObject playsRole rootObject; PersistentRoot playsRole; } /* This section pertains to support for persistent collections using B+Trees */ package pt.ist.fenixframework.pstm.collections.bplustree; valueType java.util.TreeMap as TreeMap { externalizeWith { bytearray pt.ist.fenixframework.pstm.collections.bplustree.AbstractNode.externalizeTreeMap(); } internalizeWith pt.ist.fenixframework.pstm.collections.bplustree.AbstractNode.internalizeTreeMap(); } class BPlusTree {} class AbstractNode {} class LeafNode extends AbstractNode { // key: any OID // value: any reference to a domainObject TreeMap entries; } class InnerNode extends AbstractNode { // A B-Tree node contains M keys and M+1 children. We represent the first // M children aggregated with a key and add a special LAST_KEY for the // M+1-th children. This way the i-th child always contains elements // whose keys are less than the i-th key. // key: any OID // value: a Node TreeMap subNodes; } relation BPlusTreeHasRootNode { BPlusTree playsRole; AbstractNode playsRole root; } relation NodeHasParent { AbstractNode playsRole { multiplicity *; } InnerNode playsRole parent; } relation LeafNodeHasSibling { LeafNode playsRole previous; LeafNode playsRole next; }