IDataAbstractService
Overview
This protocol specifies methods to access Data Abstract server core functionality: read data from database, apply updates, execute commands and more. The protocol is implemented in DataAbstractService_Proxy class.
Location
- Reference: DataAbstract4_Intf.h
- Namespace: DataAbstract
- Ancestry: IDataAbstractService
Required Methods
ExecuteCommand::
Executes commands by name as defined in the Schema. The return value is the number of rows affected by the command execution. Can return -1 if affected rows retrieval is not supported by the current database connection.
- (int32) ExecuteCommand:(NSString *)aCommandName :(DataParameterArray *)aParameterArray
Parameters:
- aCommandName: Name of the command in the schema.
- aParameterArray: Array of the command parameters.
ExecuteCommandEx:::
- (int32) ExecuteCommandEx:(NSString *)aCommandName :(DataParameterArray *)aInputParameters :(DataParameterArray * *)aOutputParameters
Parameters:
- aCommandName:
- aInputParameters:
- aOutputParameters:
GetCommandSchema:
Extracts and returns command definitions by name as they defined in the Schema. This method is for internal purposes.
- (NSString *) GetCommandSchema:(StringArray *)aCommandNameArray
Parameters:
- aCommandNameArray: The array containing names of commands to extract.
GetData::
The main method to select data from database. Accepts to parameters describing the query and returns the data serialized into binary stream. The stream returned should be deserialized by the compatible streamer.
- (NSData *) GetData:(StringArray *)aTableNameArray :(TableRequestInfoArray *)aTableRequestInfoArray
Parameters:
- aTableNameArray: The array containing tables names (as defined in the Schema) to query data from.
- aTableRequestInfoArray: The array of TableRequestInfo class instances describing the data query. Each instance should correspond to a table name from aTableNameArray array.
GetDatasetScripts:
Allows to retrieve dataset scripts to support client-side business rules scripting.
- (NSString *) GetDatasetScripts:(NSString *)DatasetNames
Parameters:
- DatasetNames: The comma-separated list of datasets from the schema to get scripts for.
GetSchema:
Returns the Schema used by current Data Abstract server.
- (NSString *) GetSchema:(NSString *)aFilter
Parameters:
- aFilter: Reserved.
GetTableSchema:
Return the description (as in the schema) for one or more tables (datasets).
- (NSString *) GetTableSchema:(StringArray *)aTableNameArray
Parameters:
- aTableNameArray: The array containing tables names to get the schema for.
RegisterForDataChangeNotification:
Registers the current session to receive event notification each time the data in the specified table has been changed.
- (void) RegisterForDataChangeNotification:(NSString *)aTableName
Parameters:
- aTableName: The table name to track data changes.
SQLExecuteCommand:
Executes a direct SQL command against the database server backend. This method returns number of rows affected by the SQL statement (if supported by DBMS/driver, otherwise returns -1). Any result set returned by the SQL command is ignored.
- (int32) SQLExecuteCommand:(NSString *)aSQLText
Parameters:
- aSQLText: SQL statement to execute.
SQLExecuteCommandEx::
Executes the passed SQL statement as a command. Supports Dynamic Where feature.
Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and with using proper authentication mechanisms to prevent anonymous users from making such calls.
The AllowExecuteCommands property is set False by default, to prevent SQL commands from being executed.
- (int32) SQLExecuteCommandEx:(NSString *)aSQLText :(NSString *)aDynamicWhereXML
Parameters:
- aSQLText: SQL command to execute
- aDynamicWhereXML: Dynamic Where condition as XML.
SQLGetData:::
Executes a direct SQL select command against the database server backend. Unlike the previous command the result set is not ignored and returned as a binary stream.
- (NSData *) SQLGetData:(NSString *)aSQLText :(BOOL)aIncludeSchema :(int32)aMaxRecords
Parameters:
- aSQLText: SQL statement to execute.
- aIncludeSchema: Specifies whether to include a part of Schema describing the result set structure.
- aMaxRecords: The maximum number of records to return. Pass -1 to return all records.
SQLGetDataEx::::
Executes given SQL statement and returns records as streamed data table. Supports Dynamic Where feature.
Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.
The AllowExecuteCommands property is set false by default, to prevent SQL commands from being executed.
- (NSData *) SQLGetDataEx:(NSString *)aSQLText :(BOOL)aIncludeSchema :(int32)aMaxRecords :(NSString *)aDynamicWhereXML
Parameters:
- aSQLText: Select SQL statement to execute
- aIncludeSchema: Boolean flag specifies should the result table contains data schema or not.
- aMaxRecords: Specifies the maximum number of records to retrieve. Default value is -1 means it will retrieve all records.
- aDynamicWhereXML: Dynamic Where condition XML
UnregisterForDataChangeNotification:
Unregisters the current session from data change notifications registered with RegisterForDataChangeNotification method.
- (void) UnregisterForDataChangeNotification:(NSString *)aTableName
Parameters:
- aTableName: The table name to stop tracking data changes.
UpdateData:
This method applies changed records back to the database.
- (NSData *) UpdateData:(NSData *)aDelta
Parameters:
- aDelta: The delta to apply.