Many to many demo


Is there a many to many demo available?

Something simple like: a member has 0 or more categories.

In the OO world you would do something like: aMember.Categories.Add(aCategory);

I'm kind of stuck with Aurelius here. Hope you can help.

Sincerely Edward


This is accomplished with an intermediate class that represents the many-to-many association:

TMemberCategory = class
  FId: Integer;
  FMember: TMember;
  FCategory: TCategory;

Then in both TMember and TCategory classes you will have a list of TCategoryMember object.
More info here:

I was afraid that you where going to say this. I already implemented this. Its not really ideal. You want this:  aMember.Categories.Add(aCategory) but that will mean a new many2many attribute. It is not trivial I know.  Its already on the whishlist with nr:1315