Qorus Integration Engine® Community Edition 6.0.0_dev
Loading...
Searching...
No Matches
RemoteDbDataProvider::RemoteDbTableDataProvider Class Reference

Defines a data provider based on a single SQL table. More...

Inherits AbstractDataProvider.

Public Member Methods

 constructor (string remote, DbRemoteBase db, string table)
 Creates the object.
 
 constructor (*hash< auto > options)
 Creates the object from constructor options.
 
string getName ()
 Returns the data provider name.
 
*string getDesc ()
 Returns the data provider description.
 
*AbstractDataProvider getChildProviders ()
 Returns child providers; return NOTHING if there are no child providers.
 
bool requiresTransactionManagement ()
 Returns True if the data provider supports transaction management. More...
 
 commit ()
 Commits data written to the data provider. More...
 
 rollback ()
 Rolls back data written to the data provider. More...
 
AbstractDataProviderBulkOperation getBulkInserter ()
 Returns a bulk insert operation object for the data provider. More...
 
AbstractDataProviderBulkOperation getBulkUpserter ()
 Returns a bulk upsert operation object for the data provider. More...
 
*hash< string, hash< MapperRuntimeKeyInfo > > getMapperRuntimeKeys ()
 Returns custom data mapper runtime keys. More...
 
string upsertRecordImpl (hash< auto > rec, *hash< auto > upsert_options)
 Upserts the given record to the data provider. More...
 
hash< auto > doSequenceKey (string sequence_name, hash< auto > ctx, *reference< bool > missing_input)
 Processes the sequence runtime key in mappers as a mapper key handler.
 
hash< auto > doSequenceCurrvalKey (string sequence_name, hash< auto > ctx, *reference< bool > missing_input)
 Processes the sequence_currval runtime key in mappers as a mapper key handler.
 

Public Attributes

const ProviderInfo
 Provider info.
 
const MapperKeyInfo
 Mapper runtime key info.
 
const ConstructorOptions
 Constructor options.
 
const SearchOptions
 Search options.
 
const CreateOptions
 Create options.
 
const UpsertOptions
 Upsert options.
 
const DbUpsertMap
 Maps SqlUtil Upsert Result Codes to DB Provider Upsert Result Codes.
 

Private Member Methods

*hash< string, AbstractDataField > getRecordTypeImpl (*hash< auto > search_options)
 Returns the description of the record type, if any.
 
*hash< auto > createRecordImpl (hash< auto > rec, *hash< auto > create_options)
 Writes the given record to the data provider. More...
 
*hash< auto > searchSingleRecordImpl (hash< auto > where_cond, *hash< auto > search_options)
 Returns a single record matching the search options. More...
 
AbstractDataProviderBulkRecordInterface searchRecordsBulkImpl (int block_size=1000, *hash< auto > where_cond, *hash< auto > search_options)
 Returns an iterator for zero or more records matching the search options. More...
 
RemoteDbTableRecordIterator searchRecordsImpl (*hash< auto > where_cond, *hash< auto > search_options)
 Returns an iterator for zero or more records matching the search options. More...
 
bool updateSingleRecordImpl (hash< auto > set, hash< auto > where_cond, *hash< auto > search_options)
 Updates a single record matching the search options. More...
 
int updateRecordsImpl (hash< auto > set, *hash< auto > where_cond, *hash< auto > search_options)
 Updates zero or more records matching the search options. More...
 
int deleteRecordsImpl (*hash< auto > where_cond, *hash< auto > search_options)
 Deletes zero or more records. More...
 
hash< DataProviderInfo > getStaticInfoImpl ()
 Returns data provider static info.
 

Private Attributes

string remote
 The remote connection name.
 
DbRemoteBase db
 The remote stream object.
 
string table
 The table name.
 

Detailed Description

Defines a data provider based on a single SQL table.

Member Function Documentation

◆ commit()

RemoteDbDataProvider::RemoteDbTableDataProvider::commit ( )

Commits data written to the data provider.

Has no effect if the data provider does not support transaction management

◆ createRecordImpl()

*hash< auto > RemoteDbDataProvider::RemoteDbTableDataProvider::createRecordImpl ( hash< auto >  rec,
*hash< auto >  create_options 
)
private

Writes the given record to the data provider.

Parameters
reca hash representing a single input record
create_optionsthe create options after processing by validateCreateOptions()
Returns
the data written to the data provider plus any output (returning) variables
Note
this API will commit the row to the database unless the datasource was already in a transaction before this call

◆ deleteRecordsImpl()

int RemoteDbDataProvider::RemoteDbTableDataProvider::deleteRecordsImpl ( *hash< auto >  where_cond,
*hash< auto >  search_options 
)
private

Deletes zero or more records.

Parameters
where_conda hash for identifying the record(s) to be deleted
search_optionsthe delete options after processing by validateSearchOptions()
Returns
the number of records deleted
Exceptions
INVALID-OPERATIONthe data provider does not support record updating
Note
this API will commit the row to the database unless the datasource was already in a transaction before this call

◆ getBulkInserter()

AbstractDataProviderBulkOperation RemoteDbDataProvider::RemoteDbTableDataProvider::getBulkInserter ( )

Returns a bulk insert operation object for the data provider.

Returns
a bulk insert operation object for the data provider

◆ getBulkUpserter()

AbstractDataProviderBulkOperation RemoteDbDataProvider::RemoteDbTableDataProvider::getBulkUpserter ( )

Returns a bulk upsert operation object for the data provider.

Returns
a bulk upsert operation object for the data provider

◆ getMapperRuntimeKeys()

*hash< string, hash< MapperRuntimeKeyInfo > > RemoteDbDataProvider::RemoteDbTableDataProvider::getMapperRuntimeKeys ( )

Returns custom data mapper runtime keys.

Returns
custom data mapper runtime keys

◆ requiresTransactionManagement()

bool RemoteDbDataProvider::RemoteDbTableDataProvider::requiresTransactionManagement ( )

Returns True if the data provider supports transaction management.

Returns
True if the data provider supports transaction management, in which case commit() or rollback() must be called to flush or discard data written to the data provider

◆ rollback()

RemoteDbDataProvider::RemoteDbTableDataProvider::rollback ( )

Rolls back data written to the data provider.

Has no effect if the data provider does not support transaction management

◆ searchRecordsBulkImpl()

AbstractDataProviderBulkRecordInterface RemoteDbDataProvider::RemoteDbTableDataProvider::searchRecordsBulkImpl ( int  block_size = 1000,
*hash< auto >  where_cond,
*hash< auto >  search_options 
)
private

Returns an iterator for zero or more records matching the search options.

Parameters
block_sizethe number of records in a read block; must be a positive number
where_condthe search criteria; will be processed by processFieldValues()
search_optionsthe search options; will be processed by validateSearchOptions()
Exceptions
INVALID-BLOCK-SIZEthe block size must be a positive number
INVALID-OPERATIONthe data provider does not support reading

◆ searchRecordsImpl()

RemoteDbTableRecordIterator RemoteDbDataProvider::RemoteDbTableDataProvider::searchRecordsImpl ( *hash< auto >  where_cond,
*hash< auto >  search_options 
)
private

Returns an iterator for zero or more records matching the search options.

Parameters
where_conda hash for identifying the record(s)
search_optionsthe search options after processing by validateSearchOptions()
Note
this method acquires a transaction lock if one is not already acquired; the iterator returned performs a rollback in the destructor if a new transaction lock was acquired by this call and RemoteDbTableRecordIterator::keepTransactionLock() is not called

◆ searchSingleRecordImpl()

*hash< auto > RemoteDbDataProvider::RemoteDbTableDataProvider::searchSingleRecordImpl ( hash< auto >  where_cond,
*hash< auto >  search_options 
)
private

Returns a single record matching the search options.

Parameters
where_conda hash for identifying the record(s)
search_optionsthe search options after processing by validateSearchOptions()
Exceptions
MULTIPLE-RECORDS-ERRORmultiple records found

◆ updateRecordsImpl()

int RemoteDbDataProvider::RemoteDbTableDataProvider::updateRecordsImpl ( hash< auto >  set,
*hash< auto >  where_cond,
*hash< auto >  search_options 
)
private

Updates zero or more records matching the search options.

Parameters
setthe hash of field data to set
where_conda hash for identifying the record(s) to be updated
search_optionsthe update options after processing by validateSearchOptions()
Returns
the number of records updated
Note
this API will commit the row to the database unless the datasource was already in a transaction before this call

◆ updateSingleRecordImpl()

bool RemoteDbDataProvider::RemoteDbTableDataProvider::updateSingleRecordImpl ( hash< auto >  set,
hash< auto >  where_cond,
*hash< auto >  search_options 
)
private

Updates a single record matching the search options.

Parameters
setthe hash of field data to set
where_conda hash for identifying the record to be update
search_optionsthe update options after processing by validateSearchOptions()
Exceptions
UPDATE-SINGLE-RECORD-ERRORif the update would update more than one record
Note
this API will commit the row to the database unless the datasource was already in a transaction before this call

◆ upsertRecordImpl()

string RemoteDbDataProvider::RemoteDbTableDataProvider::upsertRecordImpl ( hash< auto >  rec,
*hash< auto >  upsert_options 
)

Upserts the given record to the data provider.

Parameters
reca hash representing a single input record
upsert_optionsthe create options after processing by validateUpsertOptions()
Returns
see DB Provider Upsert Result Codes for possible values
Note
this API will commit the row to the database unless the datasource was already in a transaction before this call

The documentation for this class was generated from the following file: