IDADelta

Overview

The IDADelta interface represents a set of changes to be transmitted between client and server. These 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.

Location

Implemented in

 

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:

  • aRecordID: record ID
  • aChangeType: type of change
  • aStatus: status of the change:
  • aMessage: message

Add (TDADeltaChange)  overload

Adds a change to the set of changes.

procedure Add(aChange: TDADeltaChange)

Parameters:

  • aChange: given change.

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.

BlockedRecordCount

Returns count of unfinished changes.

property BlockedRecordCount: integer read write

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 write

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

Returns the number of Changes contained within the delta.

property Count: integer read write

CurrentChangeID

Gets the ChangeID which the next TDADeltaChange will get when adding a new entry to this TDADelta.

property CurrentChangeID: integer read write

Delete

Deletes certain on the Index change.

procedure Delete(Index: integer)

Parameters:

  • Index: given index

DeltaChangesSorted

Allows to sort delta changes

property DeltaChangesSorted: Boolean read write

EndChange

Ends changes for the specified table and applies updates.

procedure EndChange(aDataTable: TComponent)

Parameters:

  • aDataTable: given datatable

EndChangesInAllTables

Ends changes for all table and applies updates.

procedure EndChangesInAllTables

FindChange

Finds the change with given aRecID

function FindChange(aRecID: integer): TDADeltaChange

Parameters:

  • aRecID: record ID

GetCountByStatus

Gives the count of changes with certain status.

function GetCountByStatus(aChangeStatus: TDAChangeStatus): integer

Parameters:

  • aChangeStatus: given status

GetDelta

Returns delta instance

function GetDelta: TDADelta

GetInChange

Checks status of given datatable

function GetInChange(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

IsNewRecord

Indicates whether the record in question represents a newly inserted record that doesn't exist on the server yet (true) or a changed record that already exists on the server (false). If called without parameter (or with -1), the result value will indicate the status of the current record in the data table associated with the delta (client-side only). If called with a non-negative record id, it will indicate the status of that record.

function IsNewRecord(aRecordID: integer): boolean

Parameters:

  • aRecordID: record ID

IsNewRecord2

Indicates whether the record in question represents a newly inserted record that doesn't exist on the server yet (true) or a changed record that already exists on the server (false). If called without parameter (or with -1), the result value will indicate the status of the current record in the data table associated with the delta (client-side only). If called with a non-negative record id, it will indicate the status of that record.

function IsNewRecord2(aDataTable: TComponent; aRecordID: integer): boolean

Parameters:

  • aDataTable: DataTable
  • aRecordID: record ID

KeyFieldCount

Indicates the number of fields that comprise the key for this delta.

property KeyFieldCount: integer read write

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 write

LoggedFieldCount

Shows the number of fields that comprise the data for this delta.

property LoggedFieldCount: integer read write

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 write

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

RemoveChange

Removes a delta change to the list of changes maintained within the delta.

procedure RemoveChange(aChange: TDADeltaChange)

Parameters:

  • aChange: given change

RemoveLoggedField (integer)  overload

Deletes certain logged field.

procedure RemoveLoggedField(Index: integer)

Parameters:

  • Index: index of field

RemoveLoggedField (string)  overload

Deletes certain logged field.

procedure RemoveLoggedField(AFieldName: string)

Parameters:

  • AFieldName: field name

RemoveUnchangedChanges

Removes changes that don't contain any modifications.

procedure RemoveUnchangedChanges

RestoreLastChange

Restores the last change.

procedure RestoreLastChange(aDataTable: TComponent)

Parameters:

  • aDataTable: given datatable

StartChange

Starts the Delta for the specified table.

procedure StartChange(aChangeType: TDAChangeType; aDataTable: TComponent)

Parameters:

  • aChangeType: required type
  • aDataTable: given datatable

 

BlockedRecordCount

Returns count of unfinished changes.

property BlockedRecordCount: integer read write

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 write

Count

Returns the number of Changes contained within the delta.

property Count: integer read write

CurrentChangeID

Gets the ChangeID which the next TDADeltaChange will get when adding a new entry to this TDADelta.

property CurrentChangeID: integer read write

DeltaChangesSorted

Allows to sort delta changes

property DeltaChangesSorted: Boolean read write

KeyFieldCount

Indicates the number of fields that comprise the key for this delta.

property KeyFieldCount: integer read write

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 write

LoggedFieldCount

Shows the number of fields that comprise the data for this delta.

property LoggedFieldCount: integer read write

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 write

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

 

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:

  • aRecordID: record ID
  • aChangeType: type of change
  • aStatus: status of the change:
  • aMessage: message

Add (TDADeltaChange)  overload

Adds a change to the set of changes.

procedure Add(aChange: TDADeltaChange)

Parameters:

  • aChange: given change.

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.

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

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 table and applies updates.

procedure EndChangesInAllTables

FindChange

Finds the change with given aRecID

function FindChange(aRecID: integer): TDADeltaChange

Parameters:

  • aRecID: record ID

GetCountByStatus

Gives the count of changes with certain status.

function GetCountByStatus(aChangeStatus: TDAChangeStatus): integer

Parameters:

  • aChangeStatus: given status

GetDelta

Returns delta instance

function GetDelta: TDADelta

GetInChange

Checks status of given datatable

function GetInChange(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

IsNewRecord

Indicates whether the record in question represents a newly inserted record that doesn't exist on the server yet (true) or a changed record that already exists on the server (false). If called without parameter (or with -1), the result value will indicate the status of the current record in the data table associated with the delta (client-side only). If called with a non-negative record id, it will indicate the status of that record.

function IsNewRecord(aRecordID: integer): boolean

Parameters:

  • aRecordID: record ID

IsNewRecord2

Indicates whether the record in question represents a newly inserted record that doesn't exist on the server yet (true) or a changed record that already exists on the server (false). If called without parameter (or with -1), the result value will indicate the status of the current record in the data table associated with the delta (client-side only). If called with a non-negative record id, it will indicate the status of that record.

function IsNewRecord2(aDataTable: TComponent; aRecordID: integer): boolean

Parameters:

  • aDataTable: DataTable
  • aRecordID: record ID

RemoveChange

Removes a delta change to the list of changes maintained within the delta.

procedure RemoveChange(aChange: TDADeltaChange)

Parameters:

  • aChange: given change

RemoveLoggedField (integer)  overload

Deletes certain logged field.

procedure RemoveLoggedField(Index: integer)

Parameters:

  • Index: index of field

RemoveLoggedField (string)  overload

Deletes certain logged field.

procedure RemoveLoggedField(AFieldName: string)

Parameters:

  • AFieldName: field name

RemoveUnchangedChanges

Removes changes that don't contain any modifications.

procedure RemoveUnchangedChanges

RestoreLastChange

Restores the last change.

procedure RestoreLastChange(aDataTable: TComponent)

Parameters:

  • aDataTable: given datatable

StartChange

Starts the Delta for the specified table.

procedure StartChange(aChangeType: TDAChangeType; aDataTable: TComponent)

Parameters:

  • aChangeType: required type
  • aDataTable: given datatable

See Also