You are not logged in.
Pages: 1
Hello
I have a legacy base, with over 1000 tables , most with multiple primary key without ID , how can I do to use ORM ?
The only way is to convert the tables to have id?
example :
type
/ / / STATE Table
/ / - Type definition auto-generated by SynDBExplorer at 1:18 20/05/2014 13:44:50
/ / From STATE
/ / - Note que the ORM will add one missing ID field via:
/ / $ ALTER TABLE ADD STATE ID INTEGER
TSQLSTATE = class ( TSQLRecord )
protected
fSTATEABBREVIATION : RawUTF8 ;
fSTATENAME : RawUTF8 ;
fSTATEBRAZIL : Boolean ;
fCOUNTRYCODE : Int64 ;
published
/ / / Match STATE.SIGLA STATE [ CHAR 2 0 0 ] * primary key
property STATEABBREVIATION: RawUTF8 index 2 read fSTATEABBREVIATION write fSTATEABBREVIATION;
/ / / Match STATE.STATENAME [ VARCHAR 30 0 0 ]
property STATENAME: RawUTF8 index 30 read fSTATENAME write fSTATENAME;
/ / / Match STATE.STATEBRAZIL [ CHAR 1 0 0 ]
property STATEBRAZIL: Boolean index 1 read fSTATEBRAZIL write fSTATEBRAZIL;
/ / / Match STATE.COUNTRYCODE [ SMALLINT ] *
property COUNTRYCODE: Int64 read fCOUNTRYCODE write fCOUNTRYCODE;
end ;
Got any tips ?
Offline
Offline
thank you
I will be working
I've searched but have not found a ready system using mORMot, have to get me some?
A real life example.
Except mORMot\SQLite3\Samples\MainDemo\SynFile.dpr
PS I'm working on a mORMot DBExpress to drive, so I will send you complete.
Last edited by fabioquestor (2014-05-20 19:56:42)
Offline
But the primary key should be an integer, otherwise the ORM won't work...
There is no simple workaround yet...
Could you help to elaborate the reason ?
I would think that multiple-string-field primary key is rather common ?
Last edited by ComingNine (2014-05-21 15:28:42)
Offline
Offline
Very good reasoning !
Offline
Pages: 1