#1 2015-05-27 17:11:25

ludydoo
Member
Registered: 2015-01-27
Posts: 17

Bug : TSQLRecordMany

Hi,

I am trying out mORMot. I'm using an external Firebird database with the ORM.

I was trying to register a TSQLRecord that only had a TSQLRecordMany published property.

class TParty;
class TPartyType;
class TPartyTypes;

TPartyType = class(TSQLRecord)
strict private
fName : RawUTF8;
published
property Name : RawUTF8 read fName write FName;
end;

TPartyTypes = class(TSQLRecordMany)
strict private
fDest : TPartyType;
fSource : TParty;
published
property Dest : TPartyType read fDest write fDest;
property Source : TParty read fSource write fSource;
end;

TParty = class(TSQLRecord)
strict private
fPartyTypes : TPartyTypes;
published
PartyTypes : TPartyTypes read fPartyTypes write fPartyTypes;
end;

Would throw an error

Exception 'first chance' à $772C4598. Classe d'exception ESQLite3Exception avec un message 'Error SQLITE_ERROR (1) using 3.8.10.1 - 'vtable constructor failed: Party' extended_errcode=1'. Processus Easymage.TEC.Server.exe (7080)

Last edited by ludydoo (2015-05-27 17:12:07)

Offline

#2 2015-05-27 17:39:58

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

Re: Bug : TSQLRecordMany

Is a TParty with no field really useful?
It is not IMHO, since you can use a regular one-to-many relationship for this kind of data, I guess.

Offline

#3 2015-05-27 17:48:31

ludydoo
Member
Registered: 2015-01-27
Posts: 17

Re: Bug : TSQLRecordMany

No it's not useful at all. I was just setting up my TSQLRecords, and it took some time before I found out that the error occured because there were no published properties. Maybe that'll help someone stumbling on the same error.

Offline

Board footer

Powered by FluxBB