TDAUnionDataTable
Overview
The TDAUnionDataTable class represents a special schema data table that agregates data from several tables with a similar schema. The TDAUnionDataTable acts similarly to the UNION operator we use in SQL.
Concept of Union Tables
For example: In our database, we have several tables holding information about some persons. The first table holds data about our customers and the second table holds data about our employees.
In the DASchema we can create a union table called Persons that will combine the data from the Customers and the Employees tables.
The main benefit of using union tables is that the client application will work with it the same way as with a usual table. When a client application requests data from a union table, Data Abstract will select the data from the underlying tables and combine the results into a single data packet that will be sent to the client application. Or when a client application tries to apply changes in a union table, the DataAbstract service will process them properly. It will divide changes for different underlying tables and generate proper update commands. All this happens inside the Data Abstract engine and is completely transparent to the client application.
Location
- Unit: uDAUnionDataTables.pas
- Ancestry: TCollectionItem | TDASQLCommand | TDADataset | TDAUnionDataTable
constructor Create override
Creates a new instance.
constructor Create(Collection: TCollection)
Parameters:
- Collection: owner collection.
Assign (TPersistent) override (declared in TDADataset)
Copies data from a given source.
procedure Assign(aSource: TPersistent)
Parameters:
- aSource: Instance whose properties will be copied
Assign (TPersistent) override
Copies data from a given source.
procedure Assign(Source: TPersistent)
Parameters:
- Source: Source
BusinessClassID (declared in TDADataset)
The property is used for implementing business rules logic on a dataset level.
property BusinessClassID: string read write
BusinessRulesClient (declared in TDASQLCommand)
Business rule script (client-side)
property BusinessRulesClient: TDAClientBusinessRuleScript read write
BusinessRulesServer (declared in TDASQLCommand)
Business rule script (server-side)
property BusinessRulesServer: TDABusinessRuleScript read write
CustomAttributes (declared in TDASQLCommand)
Custom attributes of the sql command.
property CustomAttributes: TStrings read write
DefaultSourceTable
Represents the name of the default source table. This property is important when we inserted a new row into a union data table but did not specify the exact source table where this new record should go. In such cases, the new record will be inserted into the default source table.
property DefaultSourceTable: string read write
DeleteCommandName (declared in TDADataset)
This command will be used to apply DELETE changes for the data table back to the server. This property only needs to be assigned if your schema provides a special command for processing DELETE changes (which could be an SQL DELETE statement or a stored procedure).
property DeleteCommandName: string read write
Description (declared in TDASQLCommand)
Describes the command. This property will not be used by the Data Abstract library, but can be filled with description text for documentation purposes when defining the command in Schema Modeler.
property Description: string read write
DynamicWhereExpression (declared in TDASQLCommand)
property DynamicWhereExpression: TDAWhereExpression read write
DynamicWhereXML (declared in TDASQLCommand)
Dynamic Where xml
property DynamicWhereXML: UnicodeString read write
FieldByName (declared in TDADataset)
Finds a field based on its name. If the specified field does not exist, FieldByName raises an exception.
function FieldByName(const aName: string): TDAField
Parameters:
- aName: name of the searched field
Fields (declared in TDADataset)
Provides access to all the fields contained in the dataset.
property Fields: TDAFieldCollection read write
FindField (declared in TDADataset)
Returns an item with the specified name.
function FindField(const aName: string): TDAField
Parameters:
- aName: name of the searched field
GetDisplayName protected override (declared in TDASQLCommand)
Returns the name of the sql command as it appears in the collection editor.
function GetDisplayName: string
GetFieldCollectionClass protected virtual (declared in TDADataset)
Returns TDAFieldCollection class
function GetFieldCollectionClass: TDAFieldCollectionClass
InsertCommandName (declared in TDADataset)
This command will be used to apply INSERT changes for the data table back to the server. This property only needs to be assigned if your schema provides a special command for processing INSERT changes (which could be an SQL INSERT statement or a stored procedure).
property InsertCommandName: string read write
IsPublic (declared in TDASQLCommand)
Accessible from client-side or not.
property IsPublic: Boolean read write
Name (declared in TDASQLCommand)
Sets the name that uniquely identifies this command. This name can be the name of the underlying stored procedure, or any human-readable name that describes the purpose of the command.
property Name: string read write
ParamByName (declared in TDASQLCommand)
Locates a specific parameter defined for the command, based on its name. If no matching parameter is defined, an exception will be raised.
function ParamByName(const aName: string): TDAParam
Parameters:
- aName: name of the parameter
Params
Provides access to the parameters collection of the union data table.
property Params: TDAParamCollection read write
ReadOnly (declared in TDADataset)
Manages whether the data table is read-only (true) or not (false, default). If enabled, no changes to the data contained in the table will be permitted.
property ReadOnly: Boolean read write
SetDisplayName protected override (declared in TDASQLCommand)
Sets the name of the command as it appears in the collection editor.
procedure SetDisplayName(const Value: string)
Parameters:
- Value: value for the Name property
SourceTables
Collection of the underlying source tables.
property SourceTables: TDAUnionSourceTableCollection read write
SQLCommandCollection (declared in TDASQLCommand)
References the collection that this command belongs to. Usually, this will be the Commands property of the TDASchema that this command is defined in.
property SQLCommandCollection: TDASQLCommandCollection read
Statements
Provides access to the statements collection of the union data table.
property Statements: TDAStatementCollection read write
UpdateCommandName (declared in TDADataset)
This command will be used to apply UPDATE changes for the data table back to the server. This property only needs to be assigned if your schema provides a special command for processing UPDATE changes (which could be an SQL UPDATE statement or a stored procedure).
property UpdateCommandName: string read write
BusinessClassID (declared in TDADataset)
The property is used for implementing business rules logic on a dataset level.
property BusinessClassID: string read write
BusinessRulesClient (declared in TDASQLCommand)
Business rule script (client-side)
property BusinessRulesClient: TDAClientBusinessRuleScript read write
BusinessRulesServer (declared in TDASQLCommand)
Business rule script (server-side)
property BusinessRulesServer: TDABusinessRuleScript read write
CustomAttributes (declared in TDASQLCommand)
Custom attributes of the sql command.
property CustomAttributes: TStrings read write
DefaultSourceTable
Represents the name of the default source table. This property is important when we inserted a new row into a union data table but did not specify the exact source table where this new record should go. In such cases, the new record will be inserted into the default source table.
property DefaultSourceTable: string read write
DeleteCommandName (declared in TDADataset)
This command will be used to apply DELETE changes for the data table back to the server. This property only needs to be assigned if your schema provides a special command for processing DELETE changes (which could be an SQL DELETE statement or a stored procedure).
property DeleteCommandName: string read write
Description (declared in TDASQLCommand)
Describes the command. This property will not be used by the Data Abstract library, but can be filled with description text for documentation purposes when defining the command in Schema Modeler.
property Description: string read write
DynamicWhereExpression (declared in TDASQLCommand)
property DynamicWhereExpression: TDAWhereExpression read write
DynamicWhereXML (declared in TDASQLCommand)
Dynamic Where xml
property DynamicWhereXML: UnicodeString read write
Fields (declared in TDADataset)
Provides access to all the fields contained in the dataset.
property Fields: TDAFieldCollection read write
InsertCommandName (declared in TDADataset)
This command will be used to apply INSERT changes for the data table back to the server. This property only needs to be assigned if your schema provides a special command for processing INSERT changes (which could be an SQL INSERT statement or a stored procedure).
property InsertCommandName: string read write
IsPublic (declared in TDASQLCommand)
Accessible from client-side or not.
property IsPublic: Boolean read write
Name (declared in TDASQLCommand)
Sets the name that uniquely identifies this command. This name can be the name of the underlying stored procedure, or any human-readable name that describes the purpose of the command.
property Name: string read write
Params
Provides access to the parameters collection of the union data table.
property Params: TDAParamCollection read write
ReadOnly (declared in TDADataset)
Manages whether the data table is read-only (true) or not (false, default). If enabled, no changes to the data contained in the table will be permitted.
property ReadOnly: Boolean read write
SourceTables
Collection of the underlying source tables.
property SourceTables: TDAUnionSourceTableCollection read write
SQLCommandCollection (declared in TDASQLCommand)
References the collection that this command belongs to. Usually, this will be the Commands property of the TDASchema that this command is defined in.
property SQLCommandCollection: TDASQLCommandCollection read
Statements
Provides access to the statements collection of the union data table.
property Statements: TDAStatementCollection read write
UpdateCommandName (declared in TDADataset)
This command will be used to apply UPDATE changes for the data table back to the server. This property only needs to be assigned if your schema provides a special command for processing UPDATE changes (which could be an SQL UPDATE statement or a stored procedure).
property UpdateCommandName: string read write
constructor Create override
Creates a new instance.
constructor Create(Collection: TCollection)
Parameters:
- Collection: owner collection.
Assign (TPersistent) override (declared in TDADataset)
Copies data from a given source.
procedure Assign(aSource: TPersistent)
Parameters:
- aSource: Instance whose properties will be copied
Assign (TPersistent) override
Copies data from a given source.
procedure Assign(Source: TPersistent)
Parameters:
- Source: Source
FieldByName (declared in TDADataset)
Finds a field based on its name. If the specified field does not exist, FieldByName raises an exception.
function FieldByName(const aName: string): TDAField
Parameters:
- aName: name of the searched field
FindField (declared in TDADataset)
Returns an item with the specified name.
function FindField(const aName: string): TDAField
Parameters:
- aName: name of the searched field
GetDisplayName protected override (declared in TDASQLCommand)
Returns the name of the sql command as it appears in the collection editor.
function GetDisplayName: string
GetFieldCollectionClass protected virtual (declared in TDADataset)
Returns TDAFieldCollection class
function GetFieldCollectionClass: TDAFieldCollectionClass
ParamByName (declared in TDASQLCommand)
Locates a specific parameter defined for the command, based on its name. If no matching parameter is defined, an exception will be raised.
function ParamByName(const aName: string): TDAParam
Parameters:
- aName: name of the parameter
SetDisplayName protected override (declared in TDASQLCommand)
Sets the name of the command as it appears in the collection editor.
procedure SetDisplayName(const Value: string)
Parameters:
- Value: value for the Name property
- Data Abstract Architecture
- Schemas
- DA SQL
- Column Mappings
- Union Tables Sample (Delphi)
- TDASchema
- IDADataset
- TDADataset
- TDASQLCommand
- TDAUnionDataTableCollection
- TDAUnionSourceTable