Hi,
Consider the folwing:
TUserGrp = class
private
FId: Int64;
FDescription: string;
FHundredColumns: String;
public
end;
TUserX = class
private
FId: Int64;
FUserName: string;
FUserGrpId: Proxy<TUserGrp>;
public
end;
...
var UserGrpId: Integer;
UserGrpId := User.UserGrpId.Id;//doing this load all TUserGrp fields
...
How to get just the FUserGrpId, without get all columns in TUserGrp? we are facing some slow performance, when we have a class(Table)with a lot of associations, and don't need all columns on association tables.
Thanks, Wagner
You can use TFetchMode.Eager to load all proxy associations in a single SELECT statement so it won't execute the statement for every UserGrpId.Id you try to retrieve.
Hi,
I already do that, but when i need all associations Id, all select will be executed, with no need. This cause slow performance. I just have access to foreign key value. Like UserGrp.Id.GetValue.
Thanks, Wagner
But the foreign key value is the id value. It doesn't load the foreign key value only, unfortunately.