You are not logged in.
Pages: 1
hi ab,
in referring to this problem http://synopse.info/forum/viewtopic.php?id=1378
where is the suggested way to avoid TSQLRecordMany?
i read the documentation about neested object dynArray, tCollection and so on but in all example you never use another TSQLRecord inside.
i.e.
can i use TDynArray of packet record where one property is a TSQLRecord?
thanks,
Emanuele
Offline
No, dynamic arrays are for records, i.e. value objects.
What is proposed in the documentation is to "normalize" the database (aka "data sharding"), i.e. do not rely on JOINed tables, but try to put all needed content in one table.
For instance, an invoice will be just one TSQLRecord class, with no external TSQLRecord for items in the invoice.
The items will be stored as a dynamic array within the record.
It is more object oriented (and less RDBMS driven), and a perfect path to NoSQL databases.
(by the way, I'm preparing direct persistence of objects in mORMot via MongoDB and not a SQL database... stay tuned!)
Forget about SQL, try to think about objects.
Online
yes i understand what you mean but not all data can be put in one TSQLRecord class.
for i.e. in my case i need to join TMySQLRecordMany and TSQLAuthUser (many to many relationship) so i can't do what you mean!
But i can't use TSQLRecordMany with another TSQLRecordMany as Source, i can't use dynamic array, what i can use to implement this situation?
Offline
Pages: 1