Up to now, the TSQLRecord.ID
property was defined in
mORMot.pas
as a plain
PtrInt
/NativeInt
(i.e. Integer
under
Win32), since it was type-cast as pointer for TSQLRecord
published
properties.
We introduced a new TID
type, so that the ORM primary key would
now be defined as Int64
.
All the framework ORM process relies on the TSQLRecord
class.
This abstract TSQLRecord
class features a lot of built-in methods,
convenient to do most of the ORM process in a generic way, at record level.
It first defines a primary key field, defined as ID:
TID
, i.e. as Int64
in mORMot.pas
:
type TID = type Int64; ... TSQLRecord = class(TObject) ... property ID: TID read GetID write fID; ...
In fact, our ORM relies now on a Int64
primary key, matching
the SQLite3 ID
/RowID
primary key.
This primary key will be used as RESTful resource
identifier, for all CRUD operations.