TDADelta
Overview
The TDADelta class represents a set of changes to be transmitted between client and server. This can be client-side changes that are pending to be applied to the server database, or server-side changes that are being propagated back to the client.
This class is usually accessed through the IDADelta interface.
Location
- Unit: uDADelta.pas
- Ancestry: TDAEngineBaseObject | TDADelta
constructor Create overload
Creates a new instance.
constructor Create
constructor Create (TComponent) overload
Creates a new instance with given parameter.
constructor Create(aDataTable: TComponent)
Parameters:
- aDataTable: owner TDADataTable
constructor Create (string, Boolean) overload
Creates a new instance with given parameters.
constructor Create(const aLogicalName: string; aReducedDelta: Boolean)
Parameters:
- aLogicalName: logical name
- aReducedDelta: initializes delta as reduced delta.
Add (TDADeltaChange) overload
Adds a change to the set of changes.
procedure Add(aChange: TDADeltaChange)
Parameters:
- aChange: given change.
Add (Integer, TDAChangeType, TDAChangeStatus, string): TDADeltaChange overload
Adds a change to the set of changes.
function Add(aRecordID: Integer; aChangeType: TDAChangeType; aStatus: TDAChangeStatus; const aMessage: string): TDADeltaChange
Parameters:
AddFieldName
Adds a new field.
procedure AddFieldName(const aFieldName: string; const aDataType: TDADataType)
Parameters:
- aFieldName: field name
- aDataType: data type
AddKeyFieldName
Adds a new key field.
procedure AddKeyFieldName(const aKeyFieldName: string)
Parameters:
- aKeyFieldName: given key field
AssignDataTable
Sets datatable as owner.
procedure AssignDataTable(aDataTable: TComponent)
Parameters:
- aDataTable: given datatable.
AssignDeltaProperties protected
Copies data from a given source.
procedure AssignDeltaProperties(aSource: TDADelta)
Parameters:
- aSource: Source
CancelChange
Discards the certain change.
procedure CancelChange(aDataTable: TComponent)
Parameters:
- aDataTable: datatable where changes should be discarded
CancelChangesInAllTables
Discards all changes in all tables.
procedure CancelChangesInAllTables
Changes
Provides access to all the individual changes contained in the delta. The indexer is zero-based and the number of elements is indicated by the Count property.
property Changes[Index: Integer]: TDADeltaChange read
Clear
Clears the delta and discards all the individual changes that it contains.
procedure Clear(DoClearFieldNames: Boolean; DoClearKeyFieldNames: Boolean)
Parameters:
- DoClearFieldNames: remove all fields or not
- DoClearKeyFieldNames: remove all key fields or not
ClearFieldNames
Clears list of fields.
procedure ClearFieldNames
ClearKeyFieldNames
Clears list of key's fields.
procedure ClearKeyFieldNames
Count
Indicates the number of Changes contained within the delta.
property Count: Integer read
CurrentChange
Gives a current change.
function CurrentChange(aDataTable: TComponent): TDADeltaChange
Parameters:
- aDataTable: given datatable
CurrentChangeID
Gets the ChangeID which the next TDADeltaChange will get when adding a new entry
property CurrentChangeID: Integer read
Delete
Deletes certain on the Index change.
procedure Delete(Index: Integer)
Parameters:
- Index: given index
EndChange
Ends changes for the specified table and applies updates.
procedure EndChange(aDataTable: TComponent)
Parameters:
- aDataTable: given datatable
EndChangesInAllTables
Ends changes for all tables and applies updates.
procedure EndChangesInAllTables
FindChange
Finds the change with given aRecID
function FindChange(aRecID: Integer): TDADeltaChange
Parameters:
- aRecID: record ID
First protected safecall
Moves to the first change
function First: Boolean
GetAsBoolean (Integer): Boolean protected overload safecall
Gets the value of the field as Boolean value.
function GetAsBoolean(Index: Integer): Boolean
Parameters:
- Index: Index of the field
GetAsBoolean (string): Boolean protected overload safecall
Gets the value of the field as Boolean value.
function GetAsBoolean(const FieldName: string): Boolean
Parameters:
- FieldName: Name of the field
GetAsCurrency (Integer): Currency protected overload safecall
Gets the value of the field as 64-bit fixed point currency value.
function GetAsCurrency(Index: Integer): Currency
Parameters:
- Index: Index of the field
GetAsCurrency (string): Currency protected overload safecall
Gets the value of the field as 64-bit fixed point currency value.
function GetAsCurrency(const FieldName: string): Currency
Parameters:
- FieldName: Name of the field
GetAsDateTime (Integer): TDateTime protected overload safecall
Gets the value of the field as TDateTime value.
function GetAsDateTime(Index: Integer): TDateTime
Parameters:
- Index: Index of the field
GetAsDateTime (string): TDateTime protected overload safecall
Gets the value of the field as TDateTime value.
function GetAsDateTime(const FieldName: string): TDateTime
Parameters:
- FieldName: Name of the field
GetAsFloat (Integer): Double protected overload safecall
Gets the value of the field as Float/Double value.
function GetAsFloat(Index: Integer): Double
Parameters:
- Index: Index of the field
GetAsFloat (string): Double protected overload safecall
Gets the value of the field as Float/Double value.
function GetAsFloat(const FieldName: string): Double
Parameters:
- FieldName: Name of the field
GetAsInteger (Integer): Integer protected overload safecall
Gets the value of the field as 32-bit integer value.
function GetAsInteger(Index: Integer): Integer
Parameters:
- Index: Index of the field
GetAsInteger (string): Integer protected overload safecall
Gets the value of the field as 32-bit integer value.
function GetAsInteger(const FieldName: string): Integer
Parameters:
- FieldName: Name of the field
GetAsString (Integer): string protected overload safecall
Gets the value of the field as string value.
function GetAsString(Index: Integer): string
Parameters:
- Index: Index of the field
GetAsString (string): string protected overload safecall
Gets the value of the field as string value.
function GetAsString(const FieldName: string): string
Parameters:
- FieldName: Name of the field
GetAsVariant (Integer): Variant protected overload safecall
Gets the value of the field as variant.
function GetAsVariant(Index: Integer): Variant
Parameters:
- Index: Index of the field
GetAsVariant (string): Variant protected overload safecall
Gets the value of the field as variant.
function GetAsVariant(const FieldName: string): Variant
Parameters:
- FieldName: Name of the field
GetCountByStatus
Gives the count of changes with certain status.
function GetCountByStatus(aChangeStatus: TDAChangeStatus): Integer
Parameters:
- aChangeStatus: given status
GetDelta protected
Returns delta instance
function GetDelta: TDADelta
GetFieldCount protected safecall
Gets the number of fields contained in the dataset.
function GetFieldCount: Integer
GetFieldIndexes protected safecall
Returns the field index assosiated with the field name.
function GetFieldIndexes(const aName: string): Integer
Parameters:
- aName: Name of the field
GetFieldNames protected safecall
Returns the field name assosiated with the field index.
function GetFieldNames(Index: Integer): string
Parameters:
- Index: Index of the field
GetRecordCount protected safecall
Returns the number of delta changes
function GetRecordCount: Integer
InChange
Checks status of given datatable
function InChange(aDataTable: TComponent): Boolean
Parameters:
- aDataTable: given datatable
IndexOf
Returns the position of a aChange in the list.
function IndexOf(aChange: TDADeltaChange): Integer
Parameters:
- aChange: Change whose index will be returned.
IndexOfLoggedField
Returns the position of a logged field in the list.
function IndexOfLoggedField(const aName: string): Integer
Parameters:
- aName: field name
IsCanEditCurrentRow
Indicates whether it is possible to edit a current row in the specified table.
function IsCanEditCurrentRow(aDataTable: TComponent): Boolean
Parameters:
- aDataTable: given datatable
isIdenticalProperties protected
function isIdenticalProperties(aDelta: TDADelta): Boolean
Parameters:
- aDelta:
IsNewRecord
Indicates whether there is a certain record of new.
function IsNewRecord(aRecordID: Integer): Boolean
Parameters:
- aRecordID: record ID
IsNewRecord2
Indicates whether there is a certain record of new.
function IsNewRecord2(aDataTable: TComponent; aRecordID: Integer): Boolean
Parameters:
- aDataTable: DataTable
- aRecordID: record ID
KeyFieldCount
Returns the number of fields that comprise the key for this delta.
property KeyFieldCount: Integer read
KeyFieldNames
Lists the names of the fields that comprise the key for this delta. The indexer is zero-based and the number of elements is indicated by the KeyFieldCount property.
property KeyFieldNames[Index: Integer]: string read
Locate protected safecall
Locates and activates a record by key values.
function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean
Parameters:
- KeyFields: The semicolon-separated list of fields.
- KeyValues: Values specified by the Variant or Variant array.
- Options: Indicates whether the search is case insensitive and whether partial matches are supported.
LoggedFieldCount
Indicates the number of fields that comprise the data for this delta.
property LoggedFieldCount: Integer read
LoggedFieldNames
Holds the names of the fields that comprise the data for this delta. The indexer is zero-based and the number of elements is indicated by the LoggedFieldCount property.
property LoggedFieldNames[Index: Integer]: string read
LoggedFieldTypes
Lists the data types of the fields that comprise the data for this delta. The indexer is zero-based and the number of elements is indicated by the LoggedFieldCount property.
property LoggedFieldTypes[Index: Integer]: TDADataType read write
LogicalName
Defines the name of the logical entity that this delta pertains to. Usually, this will be the name of the data table that changes should be applied to.
property LogicalName: string read write
Next protected safecall
Moves to the next change.
function Next: Boolean
ReducedDelta
Status of reduced delta mode
property ReducedDelta: Boolean read
RemoveChange
Removes a delta change to the list of changes maintained within the delta.
procedure RemoveChange(aChange: TDADeltaChange)
Parameters:
- aChange: given change
RemoveLoggedField (string) overload
Deletes certain logged field.
procedure RemoveLoggedField(AFieldName: string)
Parameters:
- AFieldName: field name
RemoveLoggedField (Integer) overload
Deletes certain logged field.
procedure RemoveLoggedField(Index: Integer)
Parameters:
- Index: index of field
RemoveUnchangedChanges
Removes changes that don't contain any modifications.
procedure RemoveUnchangedChanges
RestoreLastChange
Restores the last change.
procedure RestoreLastChange(aDataTable: TComponent)
Parameters:
- aDataTable: given datatable
SetReducedDelta protected
Sets reduced delta mode
procedure SetReducedDelta(const aValue: Boolean)
Parameters:
- aValue: mode
StartChange
Starts the Delta for the specified table.
procedure StartChange(aChangeType: TDAChangeType; aDataTable: TComponent)
Parameters:
- aChangeType: required type
- aDataTable: given datatable
Changes
Provides access to all the individual changes contained in the delta. The indexer is zero-based and the number of elements is indicated by the Count property.
property Changes[Index: Integer]: TDADeltaChange read
Count
Indicates the number of Changes contained within the delta.
property Count: Integer read
CurrentChangeID
Gets the ChangeID which the next TDADeltaChange will get when adding a new entry
property CurrentChangeID: Integer read
KeyFieldCount
Returns the number of fields that comprise the key for this delta.
property KeyFieldCount: Integer read
KeyFieldNames
Lists the names of the fields that comprise the key for this delta. The indexer is zero-based and the number of elements is indicated by the KeyFieldCount property.
property KeyFieldNames[Index: Integer]: string read
LoggedFieldCount
Indicates the number of fields that comprise the data for this delta.
property LoggedFieldCount: Integer read
LoggedFieldNames
Holds the names of the fields that comprise the data for this delta. The indexer is zero-based and the number of elements is indicated by the LoggedFieldCount property.
property LoggedFieldNames[Index: Integer]: string read
LoggedFieldTypes
Lists the data types of the fields that comprise the data for this delta. The indexer is zero-based and the number of elements is indicated by the LoggedFieldCount property.
property LoggedFieldTypes[Index: Integer]: TDADataType read write
LogicalName
Defines the name of the logical entity that this delta pertains to. Usually, this will be the name of the data table that changes should be applied to.
property LogicalName: string read write
ReducedDelta
Status of reduced delta mode
property ReducedDelta: Boolean read
constructor Create overload
Creates a new instance.
constructor Create
constructor Create (TComponent) overload
Creates a new instance with given parameter.
constructor Create(aDataTable: TComponent)
Parameters:
- aDataTable: owner TDADataTable
constructor Create (string, Boolean) overload
Creates a new instance with given parameters.
constructor Create(const aLogicalName: string; aReducedDelta: Boolean)
Parameters:
- aLogicalName: logical name
- aReducedDelta: initializes delta as reduced delta.
Add (TDADeltaChange) overload
Adds a change to the set of changes.
procedure Add(aChange: TDADeltaChange)
Parameters:
- aChange: given change.
Add (Integer, TDAChangeType, TDAChangeStatus, string): TDADeltaChange overload
Adds a change to the set of changes.
function Add(aRecordID: Integer; aChangeType: TDAChangeType; aStatus: TDAChangeStatus; const aMessage: string): TDADeltaChange
Parameters:
AddFieldName
Adds a new field.
procedure AddFieldName(const aFieldName: string; const aDataType: TDADataType)
Parameters:
- aFieldName: field name
- aDataType: data type
AddKeyFieldName
Adds a new key field.
procedure AddKeyFieldName(const aKeyFieldName: string)
Parameters:
- aKeyFieldName: given key field
AssignDataTable
Sets datatable as owner.
procedure AssignDataTable(aDataTable: TComponent)
Parameters:
- aDataTable: given datatable.
AssignDeltaProperties protected
Copies data from a given source.
procedure AssignDeltaProperties(aSource: TDADelta)
Parameters:
- aSource: Source
CancelChange
Discards the certain change.
procedure CancelChange(aDataTable: TComponent)
Parameters:
- aDataTable: datatable where changes should be discarded
CancelChangesInAllTables
Discards all changes in all tables.
procedure CancelChangesInAllTables
Clear
Clears the delta and discards all the individual changes that it contains.
procedure Clear(DoClearFieldNames: Boolean; DoClearKeyFieldNames: Boolean)
Parameters:
- DoClearFieldNames: remove all fields or not
- DoClearKeyFieldNames: remove all key fields or not
ClearFieldNames
Clears list of fields.
procedure ClearFieldNames
ClearKeyFieldNames
Clears list of key's fields.
procedure ClearKeyFieldNames
CurrentChange
Gives a current change.
function CurrentChange(aDataTable: TComponent): TDADeltaChange
Parameters:
- aDataTable: given datatable
Delete
Deletes certain on the Index change.
procedure Delete(Index: Integer)
Parameters:
- Index: given index
EndChange
Ends changes for the specified table and applies updates.
procedure EndChange(aDataTable: TComponent)
Parameters:
- aDataTable: given datatable
EndChangesInAllTables
Ends changes for all tables and applies updates.
procedure EndChangesInAllTables
FindChange
Finds the change with given aRecID
function FindChange(aRecID: Integer): TDADeltaChange
Parameters:
- aRecID: record ID
First protected safecall
Moves to the first change
function First: Boolean
GetAsBoolean (Integer): Boolean protected overload safecall
Gets the value of the field as Boolean value.
function GetAsBoolean(Index: Integer): Boolean
Parameters:
- Index: Index of the field
GetAsBoolean (string): Boolean protected overload safecall
Gets the value of the field as Boolean value.
function GetAsBoolean(const FieldName: string): Boolean
Parameters:
- FieldName: Name of the field
GetAsCurrency (Integer): Currency protected overload safecall
Gets the value of the field as 64-bit fixed point currency value.
function GetAsCurrency(Index: Integer): Currency
Parameters:
- Index: Index of the field
GetAsCurrency (string): Currency protected overload safecall
Gets the value of the field as 64-bit fixed point currency value.
function GetAsCurrency(const FieldName: string): Currency
Parameters:
- FieldName: Name of the field
GetAsDateTime (Integer): TDateTime protected overload safecall
Gets the value of the field as TDateTime value.
function GetAsDateTime(Index: Integer): TDateTime
Parameters:
- Index: Index of the field
GetAsDateTime (string): TDateTime protected overload safecall
Gets the value of the field as TDateTime value.
function GetAsDateTime(const FieldName: string): TDateTime
Parameters:
- FieldName: Name of the field
GetAsFloat (Integer): Double protected overload safecall
Gets the value of the field as Float/Double value.
function GetAsFloat(Index: Integer): Double
Parameters:
- Index: Index of the field
GetAsFloat (string): Double protected overload safecall
Gets the value of the field as Float/Double value.
function GetAsFloat(const FieldName: string): Double
Parameters:
- FieldName: Name of the field
GetAsInteger (Integer): Integer protected overload safecall
Gets the value of the field as 32-bit integer value.
function GetAsInteger(Index: Integer): Integer
Parameters:
- Index: Index of the field
GetAsInteger (string): Integer protected overload safecall
Gets the value of the field as 32-bit integer value.
function GetAsInteger(const FieldName: string): Integer
Parameters:
- FieldName: Name of the field
GetAsString (Integer): string protected overload safecall
Gets the value of the field as string value.
function GetAsString(Index: Integer): string
Parameters:
- Index: Index of the field
GetAsString (string): string protected overload safecall
Gets the value of the field as string value.
function GetAsString(const FieldName: string): string
Parameters:
- FieldName: Name of the field
GetAsVariant (Integer): Variant protected overload safecall
Gets the value of the field as variant.
function GetAsVariant(Index: Integer): Variant
Parameters:
- Index: Index of the field
GetAsVariant (string): Variant protected overload safecall
Gets the value of the field as variant.
function GetAsVariant(const FieldName: string): Variant
Parameters:
- FieldName: Name of the field
GetCountByStatus
Gives the count of changes with certain status.
function GetCountByStatus(aChangeStatus: TDAChangeStatus): Integer
Parameters:
- aChangeStatus: given status
GetDelta protected
Returns delta instance
function GetDelta: TDADelta
GetFieldCount protected safecall
Gets the number of fields contained in the dataset.
function GetFieldCount: Integer
GetFieldIndexes protected safecall
Returns the field index assosiated with the field name.
function GetFieldIndexes(const aName: string): Integer
Parameters:
- aName: Name of the field
GetFieldNames protected safecall
Returns the field name assosiated with the field index.
function GetFieldNames(Index: Integer): string
Parameters:
- Index: Index of the field
GetRecordCount protected safecall
Returns the number of delta changes
function GetRecordCount: Integer
InChange
Checks status of given datatable
function InChange(aDataTable: TComponent): Boolean
Parameters:
- aDataTable: given datatable
IndexOf
Returns the position of a aChange in the list.
function IndexOf(aChange: TDADeltaChange): Integer
Parameters:
- aChange: Change whose index will be returned.
IndexOfLoggedField
Returns the position of a logged field in the list.
function IndexOfLoggedField(const aName: string): Integer
Parameters:
- aName: field name
IsCanEditCurrentRow
Indicates whether it is possible to edit a current row in the specified table.
function IsCanEditCurrentRow(aDataTable: TComponent): Boolean
Parameters:
- aDataTable: given datatable
isIdenticalProperties protected
function isIdenticalProperties(aDelta: TDADelta): Boolean
Parameters:
- aDelta:
IsNewRecord
Indicates whether there is a certain record of new.
function IsNewRecord(aRecordID: Integer): Boolean
Parameters:
- aRecordID: record ID
IsNewRecord2
Indicates whether there is a certain record of new.
function IsNewRecord2(aDataTable: TComponent; aRecordID: Integer): Boolean
Parameters:
- aDataTable: DataTable
- aRecordID: record ID
Locate protected safecall
Locates and activates a record by key values.
function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean
Parameters:
- KeyFields: The semicolon-separated list of fields.
- KeyValues: Values specified by the Variant or Variant array.
- Options: Indicates whether the search is case insensitive and whether partial matches are supported.
Next protected safecall
Moves to the next change.
function Next: Boolean
RemoveChange
Removes a delta change to the list of changes maintained within the delta.
procedure RemoveChange(aChange: TDADeltaChange)
Parameters:
- aChange: given change
RemoveLoggedField (string) overload
Deletes certain logged field.
procedure RemoveLoggedField(AFieldName: string)
Parameters:
- AFieldName: field name
RemoveLoggedField (Integer) overload
Deletes certain logged field.
procedure RemoveLoggedField(Index: Integer)
Parameters:
- Index: index of field
RemoveUnchangedChanges
Removes changes that don't contain any modifications.
procedure RemoveUnchangedChanges
RestoreLastChange
Restores the last change.
procedure RestoreLastChange(aDataTable: TComponent)
Parameters:
- aDataTable: given datatable
SetReducedDelta protected
Sets reduced delta mode
procedure SetReducedDelta(const aValue: Boolean)
Parameters:
- aValue: mode
StartChange
Starts the Delta for the specified table.
procedure StartChange(aChangeType: TDAChangeType; aDataTable: TComponent)
Parameters:
- aChangeType: required type
- aDataTable: given datatable