Changeset 138 for trunk/Packages/PersistentData/UPDClient.pas
- Timestamp:
- Sep 9, 2022, 8:20:25 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/PersistentData/UPDClient.pas
r137 r138 4 4 5 5 uses 6 Classes, SysUtils, SpecializedList, SpecializedDictionary;6 Classes, SysUtils, Generics.Collections, UGenerics; 7 7 8 8 const … … 57 57 ObjectName: string; 58 58 Path: string; 59 Objects: T ListObject; // TListObject<TObjectProxy>59 Objects: TObjectList<TObjectProxy>; 60 60 procedure Clear; 61 61 constructor Create; … … 74 74 { TPDTypePropertyList } 75 75 76 TPDTypePropertyList = class(T ListObject)76 TPDTypePropertyList = class(TObjectList<TPDTypeProperty>) 77 77 Client: TPDClient; 78 78 procedure AddSimple(Name: string; TypeName: string; Unique: Boolean = False; … … 100 100 { TPDTypeList } 101 101 102 TPDTypeList = class(T ListObject)102 TPDTypeList = class(TObjectList<TPDType>) 103 103 Client: TPDClient; 104 104 function AddType(Name: string; DbType: string = ''): TPDType; … … 147 147 TPDClientClass = class of TPDClient; 148 148 149 150 151 152 153 149 resourcestring 150 SClientNotSet = 'Client not set'; 151 SNotSupported = 'Not supported'; 152 SVersionMismatch = 'Version mismatch, client: %0:s, server: %1:s. Please upgrade database.'; 153 SCantLoadObjectWithoutId = 'Can''t load object without id'; 154 154 155 155 … … 163 163 NewProperty: TPDTypeProperty; 164 164 begin 165 NewProperty := TPDTypeProperty(Add New(TPDTypeProperty.Create));165 NewProperty := TPDTypeProperty(Add(TPDTypeProperty.Create)); 166 166 NewProperty.Name := Name; 167 167 NewProperty.DbType := Client.Types.SearchByName(TypeName); … … 175 175 function TPDTypeList.AddType(Name: string; DbType: string = ''): TPDType; 176 176 begin 177 Result := TPDType(Add New(TPDType.Create));177 Result := TPDType(Add(TPDType.Create)); 178 178 Result.Client := Client; 179 179 Result.Name := Name; … … 280 280 begin 281 281 ColumnsFilter := TListString.Create; 282 Objects := T ListObject.Create;282 Objects := TObjectList<TObjectProxy>.Create; 283 283 end; 284 284 … … 345 345 NewObject.Load; 346 346 347 DbVersion := NewObject.Properties. Values['Version'];347 DbVersion := NewObject.Properties.Items['Version']; 348 348 if Version <> DbVersion then 349 349 raise Exception.Create(Format(SVersionMismatch, [Version, DbVersion])); … … 395 395 Tables.Count := NewProxy.Objects.Count; 396 396 for I := 0 to NewProxy.Objects.Count - 1 do 397 Tables[I] := TObjectProxy(NewProxy.Objects[I]).Properties. Values['TABLE_NAME'];397 Tables[I] := TObjectProxy(NewProxy.Objects[I]).Properties.Items['TABLE_NAME']; 398 398 399 399 for I := 0 to Types.Count - 1 do
Note:
See TracChangeset
for help on using the changeset viewer.