【发布时间】:2015-06-16 02:01:51
【问题描述】:
我有来自 Embarcadero 的教程中的这段代码,用于将数据集作为 JSON 传递:
procedure TServerMethods1.ApplyChangesDepartmentEmployees( const ADeltaList: TFDJSONDeltas);
var LApply: TFDJSONDeltasApplyUpdates;
begin
TFDJSONDeltasApplyUpdates.Create(ADeltaList);
LApply.ApplyUpdates('Departement', FDQueryDepartment.Command);
if LApply.Errors.Count = 0 then
LApply.ApplyUpdates('Emplyees', FDQueryDepartmentEmployees.Command);
if LApply.Errors.Count > 0 then
Exception.Create(LApply.Errors.Strings.Text);
end;
但是我对代码有一些疑问:
TFDJSONDeltas 是什么? Delta 是什么意思?
为什么我必须创建 TFDJSONDeltasApplyUpdates ?
ApplyUpdates 做什么以及它的语法是什么?
这是我从文档中得到的所有信息: http://docwiki.embarcadero.com/Libraries/XE8/en/Data.FireDACJSONReflect.TFDJSONDeltasApplyUpdates
【问题讨论】: