Using JadeUserCollClass Collections

In the following example that shows the use of the JadeUserCollClass class, a user collection is defined as a subclass of MemberKeyDictionary. This collection class is used as the type for an exclusive runtime dynamic property that is added to the class of the root object.

vars
    dict : JadeUserCollClass;
    cluster : JadeDynamicPropertyCluster;
begin
    // Define the user collection as a member key dictionary
    beginTransaction;
    dict := currentSchema.addUserCollectionSubclass(MemberKeyDictionary,
                                                   "CustomersByName", 
                                                   "dbfilename");
    dict.setMembership(Customer);
    dict.addMemberKey("lastName", false, true, 0);
    dict.endKeys(true);
    commitTransaction;
    
    // Make a runtime dynamic property using the user collection 
    beginTransaction;
    cluster := Root.addDynamicPropertyCluster("RootCluster");
    cluster.addExclusiveDynamicProperty("allCustomersByName", dict);
    commitTransaction;
end;