CdsRestDataProvider::CdsEntityDataProvider Class Reference

The CdsEntityDataProvider data provider class. More...

Inherits AbstractDataProvider.

## Public Member Functions

| constructor (CdsRestClient rest, string name, hash< auto > meta)
| Creates the object from the arguments.
string | getName ()
| Returns the data provider name.

## Public Attributes

hash< auto > | meta
| metadata description
string | name
| current object name
CdsRestClient::CdsRestClient | rest
| The REST client object for API calls.

## Protected Member Functions

*hash< auto > | createRecordImpl (hash< auto > rec, *hash< auto > create_options)
| Creates the given record to the data provider. More...
int | deleteRecordsImpl (*hash< auto > where_cond, *hash< auto > search_options)
| Deletes zero or more records. More...
| deleteSingleRecord (string id)
| deletes a single record
| getRecordInfoIntern ()
| Retrieves the record type.
hash< DataProvider::DataProviderInfo > | getStaticInfoImpl ()
| Returns data provider static info.
hash< CdsRestRecordInfo > | record_info ()
| Record info for the entity.
DataProvider::AbstractDataProviderRecordIterator | searchRecordsImpl (*hash< auto > where_cond, *hash< auto > search_options)
| Returns an iterator for zero or more records matching the search options. More...
| setEntitySetName ()
| Determine the entity set name for the entity.
int | updateRecordsImpl (hash< auto > set, hash< auto > where_cond, *hash< auto > search_options)
| Updates zero or more records matching the search options. More...
| updateSingleRecord (string id, hash< auto > set)
| updates a single record
string | upsertRecordImpl (hash< auto > rec, *hash< auto > upsert_options)
| Upserts the given record to the data provider. More...

## Detailed Description

The CdsEntityDataProvider data provider class.

## Member Function Documentation

## createRecordImpl()

*hash<auto> CdsRestDataProvider::CdsEntityDataProvider::createRecordImpl | ( | hash< auto > | rec,
|  | *hash< auto > | create_options
| ) |  |

protected

Creates the given record to the data provider.

Parameters

  rec | a hash representing a single input record
  create_options | the create options after processing by validateCreateOptions()

Returns
  the data written to the data provider with the `"id"` field of the new record

Exceptions

  DUPLICATE-RECORD | this exception should be thrown if the provider fails due to an attempt to create a duplicate record

## deleteRecordsImpl()

int CdsRestDataProvider::CdsEntityDataProvider::deleteRecordsImpl | ( | *hash< auto > | where_cond,
|  | *hash< auto > | search_options
| ) |  |

protected

Deletes zero or more records.

Parameters

  where_cond | a hash for identifying the record(s) to be deleted
  search_options | the delete options after processing by validateSearchOptions()

Returns
  the number of records deleted

## searchRecordsImpl()

DataProvider::AbstractDataProviderRecordIterator CdsRestDataProvider::CdsEntityDataProvider::searchRecordsImpl | ( | *hash< auto > | where_cond,
|  | *hash< auto > | search_options
| ) |  |

protected

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

Parameters

  where_cond | the search criteria
  search_options | the search options after processing by validateSearchOptions()

See also
  requestSearchRecordsImpl()

## updateRecordsImpl()

int CdsRestDataProvider::CdsEntityDataProvider::updateRecordsImpl | ( | hash< auto > | set,
|  | hash< auto > | where_cond,
|  | *hash< auto > | search_options
| ) |  |

protected

Updates zero or more records matching the search options.

Parameters

  set | the hash of field data to set
  where_cond | a hash for identifying the record(s) to be updated
  search_options | the update options after processing by validateSearchOptions()

Returns
  the number of records updated

## upsertRecordImpl()

string CdsRestDataProvider::CdsEntityDataProvider::upsertRecordImpl | ( | hash< auto > | rec,
|  | *hash< auto > | upsert_options
| ) |  |

protected

Upserts the given record to the data provider.

Parameters

  rec | a hash representing a single input record
  upsert_options | the create options after processing by validateUpsertOptions()

Returns
  see db_provider_upsert_results for possible values