You are not logged in.
Pages: 1
I have a Class such as TDictionary, they may be one class, but many tables keep same data structure. In framework, it seems generate table name automaticly, one class point to one table.
Is there any way to define many tables with one class?
Offline
Just sub-type the class with a dedicated name:
type
TMainClass = class(TSQLRecord)
....
end;
TSQLTable1 = class(TMainClass);
TSQLTable2 = class(TMainClass);
Here, TSQLTable1 and TSQLTable2 will create "Table1" and "Table2" tables, with the same columns.
You have to put only TSQLTable1 and TSQLTable2 in your TSQLMOdel instance, not TMainClass.
But you need one type class per table.
Otherwise, how the whole ORM stuff may work?
Offline
Pages: 1