Many to many demo

Hi


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


Hi,

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


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


Then in both TMember and TCategory classes you will have a list of TCategoryMember object.
More info here: https://www.tmssoftware.com/site/forum/forum_posts.asp?TID=5261&title=many-to-many-with-aurelius

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