Delta

Overview

The Delta class contains a collection of DeltaChange items.

This collection maintains a list of inserted, deleted and updated rows in a DataTable. It's used by Data Abstract clients to send the modified rows back to the server and by the server to process the updates. deltas on the client are automatically created when RemoteDataAdapter.Update is called.

Location


 

constructor (DataTable)

 

constructor(dataTable: DataTable)

 

Delta(DataTable dataTable)

 

Sub New(dataTable As DataTable)

Parameters:

  • dataTable:

constructor (DataTable, Boolean)

 

constructor(dataTable: DataTable; isReduced: Boolean)

 

Delta(DataTable dataTable, Boolean isReduced)

 

Sub New(dataTable As DataTable, isReduced As Boolean)

Parameters:

  • dataTable:
  • isReduced:

constructor (SchemaDataTable)

 

constructor(schemaTable: SchemaDataTable)

 

Delta(SchemaDataTable schemaTable)

 

Sub New(schemaTable As SchemaDataTable)

Parameters:

  • schemaTable:

constructor (SchemaDataTable, Boolean)

 

constructor(schemaTable: SchemaDataTable; isReduced: Boolean)

 

Delta(SchemaDataTable schemaTable, Boolean isReduced)

 

Sub New(schemaTable As SchemaDataTable, isReduced As Boolean)

Parameters:

  • schemaTable:
  • isReduced:

Add (Int32): DeltaChange

 

method Add(changeId: Int32): DeltaChange

 

DeltaChange Add(Int32 changeId)

 

Function Add(changeId As Int32) As DeltaChange

Parameters:

  • changeId:

Add (DataRow): DeltaChange

 

method Add(dataRow: DataRow): DeltaChange

 

DeltaChange Add(DataRow dataRow)

 

Function Add(dataRow As DataRow) As DeltaChange

Parameters:

  • dataRow:

Changes

Provides read-only access to internal collection of DeltaChange items.

 

property Changes[index: Int32]: DeltaChange read write;

 

DeltaChange Changes[Int32 index] { get; set; }

 

Property Changes(index As Int32) As DeltaChange

ClearItems  protected

Removes all DeltaChange items from the Changes collection and resets the CurrentChangeID property value.

 

method ClearItems

 

void ClearItems()

 

Sub ClearItems()

Clone

Returns a copy of the current Delta instance. Note that both current and cloned Delta instances will contain references to the same DeltaChange instances.

 

method Clone: Object

 

Object Clone()

 

Function Clone() As Object

CopyDataTableChanges  protected

Adds all changes in the provided DataTable into the DeltaChange collection.

 

method CopyDataTableChanges(table: DataTable)

 

void CopyDataTableChanges(DataTable table)

 

Sub CopyDataTableChanges(table As DataTable)

Parameters:

  • table: DataTable which changes should be added into the DeltaChange collection.

CurrentChangeID

Gets the ChangeID which the next DeltaChange will get when adding a new entry to this Delta.

 

property CurrentChangeID: Int32 read;

 

Int32 CurrentChangeID { get; }

 

ReadOnly Property CurrentChangeID() As Int32

FieldsFilter

Provides access to the collection of field names that were present in this Delta instance.

This property is needed to gracefully handle cases when Schema definitions on the client and server applications are out of sync (for example when Server Schema was updated but some of client applications are still not updated).

Note: Direct changes to this property might lead to data loss and/or errors on the client side.

 

property FieldsFilter: array of String read write;

 

String[] FieldsFilter { get; set; }

 

Property FieldsFilter() As String()

GetDataTableSchema

Returns the corresponding SchemaDataTable for a given DataTable, or null if the DataTable doesn't have a corresponding SchemaDataTable.

 

class method GetDataTableSchema(dataTable: DataTable): SchemaDataTable

 

static SchemaDataTable GetDataTableSchema(DataTable dataTable)

 

Shared Function GetDataTableSchema(dataTable As DataTable) As SchemaDataTable

Parameters:

  • dataTable: DataTable for which the SchemaDataTable is requested

GetFieldIndexInValueArray

 

method GetFieldIndexInValueArray(fieldName: String): Int32

 

Int32 GetFieldIndexInValueArray(String fieldName)

 

Function GetFieldIndexInValueArray(fieldName As String) As Int32

Parameters:

  • fieldName:

GetNextChangeId

Gets the next available DeltaChange Id. This method uses internal counter to ensure uniqueness of returned values.

Note: It is possible to violate the Id uniqueness in case the Add(Int32) method is used.

 

method GetNextChangeId: Int32

 

Int32 GetNextChangeId()

 

Function GetNextChangeId() As Int32

IsReduced

Gets the flag indicating whether this Delta instance contains one ore more reduced DeltaChange.

 

property IsReduced: Boolean read write;

 

Boolean IsReduced { get; set; }

 

Property IsReduced() As Boolean

Name

Gets or sets the name of this Delta instance.

When the changes are sent back to the server Delta name is used to find the Data Table to which these updates belong.

By default this property is set to name of the Data Table.

 

property Name: String read write;

 

String Name { get; set; }

 

Property Name() As String

NameChangeNotification  protected

Gets or sets INameChangeNotification instance that will be notified about the Name changes.

 

property NameChangeNotification: INameChangeNotification read write;

 

INameChangeNotification NameChangeNotification { get; set; }

 

Property NameChangeNotification() As INameChangeNotification

RemoveUnnecessaryChanges

Cleans up the DeltaChange collection by removing all DeltaChange entries that don't have any data changes (ie have no data field value changes).

 

method RemoveUnnecessaryChanges

 

void RemoveUnnecessaryChanges()

 

Sub RemoveUnnecessaryChanges()

Schema

Gets the Delta's owner.

When the Delta class instance is instantiated reference to the SchemaDataTable is passed as a parameter and its name is used for the name of this Delta.

On the server, the BusinessProcessor uses value of this property to identify the table to which this Delta belongs.

 

property Schema: SchemaDataTable read;

 

SchemaDataTable Schema { get; }

 

ReadOnly Property Schema() As SchemaDataTable

ToDetailedString

 

method ToDetailedString: String

 

String ToDetailedString()

 

Function ToDetailedString() As String

 

Changes

Provides read-only access to internal collection of DeltaChange items.

 

property Changes[index: Int32]: DeltaChange read write;

 

DeltaChange Changes[Int32 index] { get; set; }

 

Property Changes(index As Int32) As DeltaChange

CurrentChangeID

Gets the ChangeID which the next DeltaChange will get when adding a new entry to this Delta.

 

property CurrentChangeID: Int32 read;

 

Int32 CurrentChangeID { get; }

 

ReadOnly Property CurrentChangeID() As Int32

FieldsFilter

Provides access to the collection of field names that were present in this Delta instance.

This property is needed to gracefully handle cases when Schema definitions on the client and server applications are out of sync (for example when Server Schema was updated but some of client applications are still not updated).

Note: Direct changes to this property might lead to data loss and/or errors on the client side.

 

property FieldsFilter: array of String read write;

 

String[] FieldsFilter { get; set; }

 

Property FieldsFilter() As String()

IsReduced

Gets the flag indicating whether this Delta instance contains one ore more reduced DeltaChange.

 

property IsReduced: Boolean read write;

 

Boolean IsReduced { get; set; }

 

Property IsReduced() As Boolean

Name

Gets or sets the name of this Delta instance.

When the changes are sent back to the server Delta name is used to find the Data Table to which these updates belong.

By default this property is set to name of the Data Table.

 

property Name: String read write;

 

String Name { get; set; }

 

Property Name() As String

NameChangeNotification  protected

Gets or sets INameChangeNotification instance that will be notified about the Name changes.

 

property NameChangeNotification: INameChangeNotification read write;

 

INameChangeNotification NameChangeNotification { get; set; }

 

Property NameChangeNotification() As INameChangeNotification

Schema

Gets the Delta's owner.

When the Delta class instance is instantiated reference to the SchemaDataTable is passed as a parameter and its name is used for the name of this Delta.

On the server, the BusinessProcessor uses value of this property to identify the table to which this Delta belongs.

 

property Schema: SchemaDataTable read;

 

SchemaDataTable Schema { get; }

 

ReadOnly Property Schema() As SchemaDataTable

 

GetDataTableSchema

Returns the corresponding SchemaDataTable for a given DataTable, or null if the DataTable doesn't have a corresponding SchemaDataTable.

 

class method GetDataTableSchema(dataTable: DataTable): SchemaDataTable

 

static SchemaDataTable GetDataTableSchema(DataTable dataTable)

 

Shared Function GetDataTableSchema(dataTable As DataTable) As SchemaDataTable

Parameters:

  • dataTable: DataTable for which the SchemaDataTable is requested

 

constructor (DataTable)

 

constructor(dataTable: DataTable)

 

Delta(DataTable dataTable)

 

Sub New(dataTable As DataTable)

Parameters:

  • dataTable:

constructor (DataTable, Boolean)

 

constructor(dataTable: DataTable; isReduced: Boolean)

 

Delta(DataTable dataTable, Boolean isReduced)

 

Sub New(dataTable As DataTable, isReduced As Boolean)

Parameters:

  • dataTable:
  • isReduced:

constructor (SchemaDataTable)

 

constructor(schemaTable: SchemaDataTable)

 

Delta(SchemaDataTable schemaTable)

 

Sub New(schemaTable As SchemaDataTable)

Parameters:

  • schemaTable:

constructor (SchemaDataTable, Boolean)

 

constructor(schemaTable: SchemaDataTable; isReduced: Boolean)

 

Delta(SchemaDataTable schemaTable, Boolean isReduced)

 

Sub New(schemaTable As SchemaDataTable, isReduced As Boolean)

Parameters:

  • schemaTable:
  • isReduced:

Add (Int32): DeltaChange

 

method Add(changeId: Int32): DeltaChange

 

DeltaChange Add(Int32 changeId)

 

Function Add(changeId As Int32) As DeltaChange

Parameters:

  • changeId:

Add (DataRow): DeltaChange

 

method Add(dataRow: DataRow): DeltaChange

 

DeltaChange Add(DataRow dataRow)

 

Function Add(dataRow As DataRow) As DeltaChange

Parameters:

  • dataRow:

ClearItems  protected

Removes all DeltaChange items from the Changes collection and resets the CurrentChangeID property value.

 

method ClearItems

 

void ClearItems()

 

Sub ClearItems()

Clone

Returns a copy of the current Delta instance. Note that both current and cloned Delta instances will contain references to the same DeltaChange instances.

 

method Clone: Object

 

Object Clone()

 

Function Clone() As Object

CopyDataTableChanges  protected

Adds all changes in the provided DataTable into the DeltaChange collection.

 

method CopyDataTableChanges(table: DataTable)

 

void CopyDataTableChanges(DataTable table)

 

Sub CopyDataTableChanges(table As DataTable)

Parameters:

  • table: DataTable which changes should be added into the DeltaChange collection.

GetFieldIndexInValueArray

 

method GetFieldIndexInValueArray(fieldName: String): Int32

 

Int32 GetFieldIndexInValueArray(String fieldName)

 

Function GetFieldIndexInValueArray(fieldName As String) As Int32

Parameters:

  • fieldName:

GetNextChangeId

Gets the next available DeltaChange Id. This method uses internal counter to ensure uniqueness of returned values.

Note: It is possible to violate the Id uniqueness in case the Add(Int32) method is used.

 

method GetNextChangeId: Int32

 

Int32 GetNextChangeId()

 

Function GetNextChangeId() As Int32

RemoveUnnecessaryChanges

Cleans up the DeltaChange collection by removing all DeltaChange entries that don't have any data changes (ie have no data field value changes).

 

method RemoveUnnecessaryChanges

 

void RemoveUnnecessaryChanges()

 

Sub RemoveUnnecessaryChanges()

ToDetailedString

 

method ToDetailedString: String

 

String ToDetailedString()

 

Function ToDetailedString() As String