#1 2021-06-21 17:01:19

zakaria
Member
Registered: 2021-06-21
Posts: 26

mORMot2 Pivot Tables as Source or Dest in other Classes

Hi ,I have a problem in creating a structure of relations between classes using pivot tables, i mean "One To Many" cardinality: (using mORMot2)
example:

TOrmX= class(TOrm);

TOrmY = class(TOrm);


TOrmXY = class(TOrmMany)
private
    fSource: TOrmX;
    fDest: TOrmY ;
  published
    property Source: TOrmX read fSource;
    property Dest: TOrmY read fDest;
  end;

=> The XY created as suggested it have both Source in Dest Cols in DB.

!!! But the problem is here : when we want use TOrmXY as Source or Dest in other class;
Example:

TOrmXYZ = class(TOrmMany)
  private
    fSource: TOrmXY ;
    fDest: TAuthGroup;
  published
    property Source: TOrmXY read fSource;
    property Dest: TAuthGroup read fDest;
  end;

in DB; the Source property doesn't created in DB.

Any Help Please !, Thanks smile

Offline

#2 2021-06-22 07:19:23

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: mORMot2 Pivot Tables as Source or Dest in other Classes

TOrmMany is to create pivot tables for a single table.

You can't share the TOrmXY in two tables, I am afraid.

Offline

Board footer

Powered by FluxBB