You are not logged in.
Pages: 1
After upgrade to last NightlyBuild I get an error like "ITest.GetUser failed on aUser:TSQLMyUser [returned object]."
The error appears when I try to get an object that contains a field of type TSQLRecordMany.
Test Model:
TSQLMyUser = class;
TSQLMyRole = class(TSQLRecord)
end;
TSQLMyUserRole = class(TSQLRecordMany)
private
fSource: TSQLMyUser;
fDest: TSQLMyRole;
published
property Source: TSQLMyUser read fSource; // map Source column
property Dest: TSQLMyRole read fDest; // map Dest column
end;
TSQLMyUser = class(TSQLRecord)
private
FRoles: TSQLMyUserRole;
published
property Roles: TSQLMyUserRole read FRoles;
end;
And a simple "Interface based services":
ITest = interface(IInvokable)
['{9A60C8ED-CEB2-4E09-87D4-4A16F496E5FE}']
function GetUser(out aUser: TSQLMyUser): boolean;
end;
Offline
https://drive.google.com/open?id=1Fe43Q … n-AMgHhte9
It is the simple project to reproduce the problem.
Offline
I have compare old and new code and found out a key difference:
function PropIsIDTypeCastedField(Prop: PPropInfo; IsObj: TJSONObject;
Value: TObject): boolean;
begin // see [22ce911c715]
if (Value<>nil) and (Prop^.PropType^.ClassSQLFieldType=sftID) then // <-- deleted in new code
case IsObj of
oSQLMany:
if IdemPropName(Prop^.Name,'source') or IdemPropName(Prop^.Name,'dest') then
result := true else
result := not TSQLRecord(Value).fFill.JoinedFields;
oSQLRecord:
result := not TSQLRecord(Value).fFill.JoinedFields;
else result := false;
end else
result := false; // assume true instance by default // <-- deleted in new code
end;
ab, could you check my investigate?
Offline
You are right.
There was a regression in this commit.
Please check https://synopse.info/fossil/info/5662a94809
Offline
Thanks, ab. It is ok now
Offline
Pages: 1