TDACustomDataAdapter
Overview
The TDACustomDataAdapter class represents the base functions for client-side access to a set of data tables published on the server.
The TDACustomDataAdapter class is the base class for the following descendant classes: the TDABaseDataAdapter class, the TDARemoteDataAdapter class (a centralized visual component for fetching data from a DataAbstract server and sending it back (see more in the Remote Data Adapters article)), the TDALocalDataAdapter class (a visual component that allows access to data from the local service (see more in the Local Data Adapters article)).
The TDACustomDataAdapter class can be used as the base class to retrieve schema information, to fill a DataSet with data from the server or to apply local updates back to the server.
You do not need to use this class directly, but you will often use the descendants of this class: the TDARemoteDataAdapter and TDALocalDataAdapter components.
Location
- Unit: uDADataTable.pas
- Ancestry: TComponent | TROComponent | TDACustomDataAdapter
constructor Create override
Standard component constructor
constructor Create(AOwner: TComponent)
Parameters:
- AOwner: Owner
ApplyUpdates virtual abstract
Applies local updates, which are represented in the collection of data tables, back to the server and returns true if the updates were successfully applied on the server. Otherwise returns false.
function ApplyUpdates(aTables: array of TDADataTable; aRefetchAll: Boolean): Boolean
Parameters:
- aTables: Input collection of data tables with updates that should be applied on the server.
- aRefetchAll:
True
: the data tables reopen after applying updates on the server.False
: they don't reopen. By default, this parameter equalsFalse
.
Assign override (declared in TROComponent)
Copies the contents of another, similar object.
procedure Assign(Source: TPersistent)
Parameters:
- Source: Instance whose properties will be copied
CheckProperties virtual abstract
Validates the data adapter properties.
procedure CheckProperties(ACheckOnlyDataStreamer: Boolean)
Parameters:
- ACheckOnlyDataStreamer: True if only the data streamer should be checked, otherwise False. By default, this parameter equals False.
DataStreamer protected
Defines the type of data streamer to be used for reading and writing data from and to the network. The type of streamer assigned here must match the streamer used on the ServiceDataStreamer property of the sever in the descendant classes.
property DataStreamer: TDADataStreamer read write
Fill (array of TDADataTable, Boolean, Boolean, Boolean) overload virtual abstract
Retrieves data from the server for all of the specified TDADataTables. In most scenarios you will not call this method yourself, but simply open the respective data table, causing data to be retrieved automatically. However, calling Fill yourself provides additional flexibility, including the option to fill multiple data tables at the same time, avoiding unnecessary server round-trips.
procedure Fill(aTables: array of TDADataTable; aSaveCursor: Boolean; aIncludeSchema: Boolean; aAppendMode: Boolean)
Parameters:
- aTables: The specified collection of data tables that should receive the data from the server.
- aSaveCursor: Defines whether the cursors that are related with the collection of data tables should be saved (true) or not (false).
- aIncludeSchema: Defines whether the schema should be included while creating table request information (true) or not (false).
- aAppendMode: Defines whether the AppendMode in the related TDATableOptionsArray collection should be set (true) or not (false). By default, this parameter equals false.
FillSchema virtual abstract
Retrieves schema information for all specified TDADataTables, and configures their Fields and Params setup to match the schema from the server. You can perform the same task at design-time for individual data tables by right-clicking the data table component and selecting "Retrieve DataTable Schema" from the context menu.
procedure FillSchema(aTables: array of TDADataTable; aPreserveLookupFields: Boolean; areserveClientCalcFields: Boolean)
Parameters:
- aTables: The specified collection of data tables that should receive the schema information.
- aPreserveLookupFields: Defines whether the collection of lookup fields should be preserved (
true
) or not (false
). By default, this parameter equals false - areserveClientCalcFields: Defines whether the collection of calculated fields should be reserved (
true
) or not (false
). By default, this parameter equals false
FillScripts virtual abstract
Retrieves business rules scripts for all specified TDADataTables from the server.
procedure FillScripts(aTables: array of TDADataTable)
Parameters:
- aTables: The specified collection of data tables that should receive business rules scripts.
FillWithDASql (array of TDADataTable, array of string) overload virtual abstract
procedure FillWithDASql(aTables: array of TDADataTable; aSQLs: array of string)
Parameters:
- aTables:
- aSQLs:
Get_GetDataCall protected virtual
Describes the server call that will be used to fetch data from the server.
This function is only used for backward compatibility to provide access to this function in the legacy events in the TDADataTable.
function Get_GetDataCall: TDARemoteRequest
Get_GetSchemaCall protected virtual
Describes the server call that will be used to obtain schema information from the server.
This function is only used for backward compatibility to provide access to this function in the legacy events in the TDADataTable.
function Get_GetSchemaCall: TDARemoteRequest
Get_GetScriptsCall protected virtual
Gets access to the server call that will be used to download business rules scripts.
This function is only used for backward compatibility to provide access to this function in the legacy events in the TDADataTable
function Get_GetScriptsCall: TDARemoteRequest
Get_UpdateDataCall protected virtual
Describes the server call that will be used to apply changes back to the server.
This function is only used for backward compatibility to provide access to this function in the legacy events in the TDADataTable.
function Get_UpdateDataCall: TDARemoteRequest
GetLinkedTables
Returns list of datatables that use given DataAdapter
function GetLinkedTables: TList<TComponent>
Notification protected override
Forwards notification messages to all owned components.
procedure Notification(AComponent: TComponent; Operation: TOperation)
Parameters:
- AComponent: component
- Operation: operation
ROFreeNotification (declared in TROComponent)
Forwards notification messages to all owned components.
procedure ROFreeNotification(aComponent: TComponent)
Parameters:
- aComponent: component
RORemoveFreeNotification (declared in TROComponent)
Forwards notification messages to all owned components.
procedure RORemoveFreeNotification(aComponent: TComponent)
Parameters:
- aComponent: component
Schema protected
Server's schema.
property Schema: TDAClientSchema read
SendRemoveNotification protected (declared in TROComponent)
Forwards notification messages to all owned components.
procedure SendRemoveNotification(aComponent: TComponent)
Parameters:
- aComponent: component
DataStreamer protected
Defines the type of data streamer to be used for reading and writing data from and to the network. The type of streamer assigned here must match the streamer used on the ServiceDataStreamer property of the sever in the descendant classes.
property DataStreamer: TDADataStreamer read write
Schema protected
Server's schema.
property Schema: TDAClientSchema read
constructor Create override
Standard component constructor
constructor Create(AOwner: TComponent)
Parameters:
- AOwner: Owner
ApplyUpdates virtual abstract
Applies local updates, which are represented in the collection of data tables, back to the server and returns true if the updates were successfully applied on the server. Otherwise returns false.
function ApplyUpdates(aTables: array of TDADataTable; aRefetchAll: Boolean): Boolean
Parameters:
- aTables: Input collection of data tables with updates that should be applied on the server.
- aRefetchAll:
True
: the data tables reopen after applying updates on the server.False
: they don't reopen. By default, this parameter equalsFalse
.
Assign override (declared in TROComponent)
Copies the contents of another, similar object.
procedure Assign(Source: TPersistent)
Parameters:
- Source: Instance whose properties will be copied
CheckProperties virtual abstract
Validates the data adapter properties.
procedure CheckProperties(ACheckOnlyDataStreamer: Boolean)
Parameters:
- ACheckOnlyDataStreamer: True if only the data streamer should be checked, otherwise False. By default, this parameter equals False.
Fill (array of TDADataTable, Boolean, Boolean, Boolean) overload virtual abstract
Retrieves data from the server for all of the specified TDADataTables. In most scenarios you will not call this method yourself, but simply open the respective data table, causing data to be retrieved automatically. However, calling Fill yourself provides additional flexibility, including the option to fill multiple data tables at the same time, avoiding unnecessary server round-trips.
procedure Fill(aTables: array of TDADataTable; aSaveCursor: Boolean; aIncludeSchema: Boolean; aAppendMode: Boolean)
Parameters:
- aTables: The specified collection of data tables that should receive the data from the server.
- aSaveCursor: Defines whether the cursors that are related with the collection of data tables should be saved (true) or not (false).
- aIncludeSchema: Defines whether the schema should be included while creating table request information (true) or not (false).
- aAppendMode: Defines whether the AppendMode in the related TDATableOptionsArray collection should be set (true) or not (false). By default, this parameter equals false.
FillSchema virtual abstract
Retrieves schema information for all specified TDADataTables, and configures their Fields and Params setup to match the schema from the server. You can perform the same task at design-time for individual data tables by right-clicking the data table component and selecting "Retrieve DataTable Schema" from the context menu.
procedure FillSchema(aTables: array of TDADataTable; aPreserveLookupFields: Boolean; areserveClientCalcFields: Boolean)
Parameters:
- aTables: The specified collection of data tables that should receive the schema information.
- aPreserveLookupFields: Defines whether the collection of lookup fields should be preserved (
true
) or not (false
). By default, this parameter equals false - areserveClientCalcFields: Defines whether the collection of calculated fields should be reserved (
true
) or not (false
). By default, this parameter equals false
FillScripts virtual abstract
Retrieves business rules scripts for all specified TDADataTables from the server.
procedure FillScripts(aTables: array of TDADataTable)
Parameters:
- aTables: The specified collection of data tables that should receive business rules scripts.
FillWithDASql (array of TDADataTable, array of string) overload virtual abstract
procedure FillWithDASql(aTables: array of TDADataTable; aSQLs: array of string)
Parameters:
- aTables:
- aSQLs:
Get_GetDataCall protected virtual
Describes the server call that will be used to fetch data from the server.
This function is only used for backward compatibility to provide access to this function in the legacy events in the TDADataTable.
function Get_GetDataCall: TDARemoteRequest
Get_GetSchemaCall protected virtual
Describes the server call that will be used to obtain schema information from the server.
This function is only used for backward compatibility to provide access to this function in the legacy events in the TDADataTable.
function Get_GetSchemaCall: TDARemoteRequest
Get_GetScriptsCall protected virtual
Gets access to the server call that will be used to download business rules scripts.
This function is only used for backward compatibility to provide access to this function in the legacy events in the TDADataTable
function Get_GetScriptsCall: TDARemoteRequest
Get_UpdateDataCall protected virtual
Describes the server call that will be used to apply changes back to the server.
This function is only used for backward compatibility to provide access to this function in the legacy events in the TDADataTable.
function Get_UpdateDataCall: TDARemoteRequest
GetLinkedTables
Returns list of datatables that use given DataAdapter
function GetLinkedTables: TList<TComponent>
Notification protected override
Forwards notification messages to all owned components.
procedure Notification(AComponent: TComponent; Operation: TOperation)
Parameters:
- AComponent: component
- Operation: operation
ROFreeNotification (declared in TROComponent)
Forwards notification messages to all owned components.
procedure ROFreeNotification(aComponent: TComponent)
Parameters:
- aComponent: component
RORemoveFreeNotification (declared in TROComponent)
Forwards notification messages to all owned components.
procedure RORemoveFreeNotification(aComponent: TComponent)
Parameters:
- aComponent: component
SendRemoveNotification protected (declared in TROComponent)
Forwards notification messages to all owned components.
procedure SendRemoveNotification(aComponent: TComponent)
Parameters:
- aComponent: component