TDADeltaChange

Overview

The TDADeltaChange class represents an individual changed record with in the TDADelta or IDADelta collection of changes.

Location


 

constructor Create

Creates a new instance.

constructor Create(aDelta: TDADelta; aRecID: Integer; aChangeType: TDAChangeType; aStatus: TDAChangeStatus; aMessage: string)

Parameters:

  • aDelta: owner delta
  • aRecID: RecordID
  • aChangeType: the type of change
  • aStatus: the current status of the change:
  • aMessage: message

Changed

Indicates that field value was changed

property Changed[aName: Variant]: Boolean read

ChangeType

Specifies the type of change represented by this record:

  • The change represents a new record to be inserted into the database. OldValues will not be defined.
  • The change represents a changed record that should be updated in the database.
  • The change represents a record that should be deleted from the database. NewValues will not be defined.
property ChangeType: TDAChangeType read write

Delta

References the delta that this delta change is part of.

property Delta: IDADelta read

GetCurrentValues  protected

Gets current value of the field specified via its name or index

function GetCurrentValues(aName: Variant): Variant

Parameters:

  • aName: field name (string) or field index (integer)

GetFieldCount  protected

Returns count of fields in this change

function GetFieldCount: Integer

GetFieldName  protected

Returns the field name assosiated with the field index.

function GetFieldName(aIndex: Integer): string

Parameters:

  • aIndex: Index of the field

GetFieldType  protected

Returns

function GetFieldType(aIndex: Variant): TDADataType

Parameters:

  • aIndex: Index of the field

GetPreviousValues  protected

Gets previous value of the field specified via its name or index

function GetPreviousValues(aName: Variant): Variant

Parameters:

  • aName: field name (string) or field index (integer)

GetTableName  protected

Returns associated table name.

function GetTableName: string

Message

Contains any message returned from the server about the change. Typically this will be an error message, if the change failed to be applied.

property Message: string read write

NewValueByName

Provides access to the new field values, indexed by field name.

property NewValueByName[aName: string]: Variant read write

NewValues

Holds the new values the record has been changed to. These values will be written to the database. For obvious reasons, this indexer property will not be available on DELETE changes, as there are no new values to be written to the database for those.

property NewValues: TVariantArray read write

OldValueByName

Provides access to the old field values, indexed by field name.

property OldValueByName[aName: string]: Variant read write

OldValues

Contains the old, or original values of the record, before the change. These values will be used on the server to locate the original record. For obvious reasons, this indexer property will not be available on INSERT changes, as there is no old and existing record in the database for those, yet.

property OldValues: TVariantArray read write

QueryInterface  protected stdcall    (declared in TDAInterfacedObject)

Implements the IInterfaceQueryInterface method.

function QueryInterface(const IID: TGUID; out Obj: ): HResult

Parameters:

  • IID: Identifier of the interface to return
  • Obj: Variable to store the returned interface reference to

RecID

Contains the internal RecordID of the record this change pertains to. This RecordID is used internally by Data Abstract to locate the appropriate records on the client side.

property RecID: Integer read write

RefCount  protected    (declared in TDAInterfacedObject)

Returns 0

property RefCount: Integer read

RefreshedByServer

Indicates whether this delta change contains values that were refreshed from the back-end database and should be merged back into the local data on the client.

property RefreshedByServer: Boolean read write

SetCurrentValues  protected

Sets current value of the field specified via its name or index

procedure SetCurrentValues(aName: Variant; aValue: Variant)

Parameters:

  • aName: field name (string) or field index (integer)
  • aValue: new value

Status

Describes the current status of the change:

  • The change still needs to be applied to the back-end database.
  • The change has been successfully applied to the database.
  • Applying the change to the database has failed. Typically, the TDADeltaChange.Message property will contain information about the failure.
property Status: TDAChangeStatus read write

 

Changed

Indicates that field value was changed

property Changed[aName: Variant]: Boolean read

ChangeType

Specifies the type of change represented by this record:

  • The change represents a new record to be inserted into the database. OldValues will not be defined.
  • The change represents a changed record that should be updated in the database.
  • The change represents a record that should be deleted from the database. NewValues will not be defined.
property ChangeType: TDAChangeType read write

Delta

References the delta that this delta change is part of.

property Delta: IDADelta read

Message

Contains any message returned from the server about the change. Typically this will be an error message, if the change failed to be applied.

property Message: string read write

NewValueByName

Provides access to the new field values, indexed by field name.

property NewValueByName[aName: string]: Variant read write

NewValues

Holds the new values the record has been changed to. These values will be written to the database. For obvious reasons, this indexer property will not be available on DELETE changes, as there are no new values to be written to the database for those.

property NewValues: TVariantArray read write

OldValueByName

Provides access to the old field values, indexed by field name.

property OldValueByName[aName: string]: Variant read write

OldValues

Contains the old, or original values of the record, before the change. These values will be used on the server to locate the original record. For obvious reasons, this indexer property will not be available on INSERT changes, as there is no old and existing record in the database for those, yet.

property OldValues: TVariantArray read write

RecID

Contains the internal RecordID of the record this change pertains to. This RecordID is used internally by Data Abstract to locate the appropriate records on the client side.

property RecID: Integer read write

RefCount  protected    (declared in TDAInterfacedObject)

Returns 0

property RefCount: Integer read

RefreshedByServer

Indicates whether this delta change contains values that were refreshed from the back-end database and should be merged back into the local data on the client.

property RefreshedByServer: Boolean read write

Status

Describes the current status of the change:

  • The change still needs to be applied to the back-end database.
  • The change has been successfully applied to the database.
  • Applying the change to the database has failed. Typically, the TDADeltaChange.Message property will contain information about the failure.
property Status: TDAChangeStatus read write

 

constructor Create

Creates a new instance.

constructor Create(aDelta: TDADelta; aRecID: Integer; aChangeType: TDAChangeType; aStatus: TDAChangeStatus; aMessage: string)

Parameters:

  • aDelta: owner delta
  • aRecID: RecordID
  • aChangeType: the type of change
  • aStatus: the current status of the change:
  • aMessage: message

GetCurrentValues  protected

Gets current value of the field specified via its name or index

function GetCurrentValues(aName: Variant): Variant

Parameters:

  • aName: field name (string) or field index (integer)

GetFieldCount  protected

Returns count of fields in this change

function GetFieldCount: Integer

GetFieldName  protected

Returns the field name assosiated with the field index.

function GetFieldName(aIndex: Integer): string

Parameters:

  • aIndex: Index of the field

GetFieldType  protected

Returns

function GetFieldType(aIndex: Variant): TDADataType

Parameters:

  • aIndex: Index of the field

GetPreviousValues  protected

Gets previous value of the field specified via its name or index

function GetPreviousValues(aName: Variant): Variant

Parameters:

  • aName: field name (string) or field index (integer)

GetTableName  protected

Returns associated table name.

function GetTableName: string

QueryInterface  protected stdcall    (declared in TDAInterfacedObject)

Implements the IInterfaceQueryInterface method.

function QueryInterface(const IID: TGUID; out Obj: ): HResult

Parameters:

  • IID: Identifier of the interface to return
  • Obj: Variable to store the returned interface reference to

SetCurrentValues  protected

Sets current value of the field specified via its name or index

procedure SetCurrentValues(aName: Variant; aValue: Variant)

Parameters:

  • aName: field name (string) or field index (integer)
  • aValue: new value