Qore DbDataProvider Module Reference  1.0.1
DbTableDataProvider.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
26 namespace DbDataProvider {
28 class DbTableDataProvider : public AbstractDataProvider {
29 
30 public:
32  const ProviderInfo = ...;
33 
34 
36 
41  const MapperKeyInfo = ...;
42 
43 
45  const ConstructorOptions = ...;
46 
47 
49 
58  const CreateOptions = ...;
59 
60 
62 
69  const UpsertOptions = ...;
70 
71 
73 
96  const SearchOptions = ...;
97 
98 
100  const DbUpsertMap = ...;
101 
102 
103 protected:
105  AbstractTable table;
106 
108  AbstractDatabase db;
109 
111  Mutex db_lock();
112 
113 public:
114 
116  constructor(AbstractTable table);
117 
118 
120  constructor(*hash<auto> options);
121 
122 
124  string getName();
125 
126 
128  *AbstractDataProvider getChildProviders();
129 
130 
132 
136 
137 
139 
147 
148 
150 
156 
157 
159 
165 
166 
168 
170  AbstractDataProviderBulkOperation getBulkInserter();
171 
172 
174 
176  AbstractDataProviderBulkOperation getBulkUpserter();
177 
178 
180 
182  *hash<string, hash<MapperRuntimeKeyInfo>> getMapperRuntimeKeys();
183 
184 
186 protected:
187  *hash<string, AbstractDataField> getRecordTypeImpl(*hash<auto> search_options);
188 public:
189 
190 
192 
200 protected:
201  *hash<auto> createRecordImpl(hash<auto> rec, *hash<auto> create_options);
202 public:
203 
204 
206 
214  string upsertRecordImpl(hash<auto> rec, *hash<auto> upsert_options);
215 
216 
218 
222 protected:
223  *hash<auto> searchSingleRecordImpl(hash<auto> where_cond, *hash<auto> search_options);
224 public:
225 
226 
228 
235 protected:
236  AbstractDataProviderBulkRecordInterface searchRecordsBulkImpl(int block_size = 1000, *hash<auto> where_cond, *hash<auto> search_options);
237 public:
238 
239 
241 
248 protected:
249  DbTableRecordIterator searchRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
250 public:
251 
252 
254 
263 protected:
264  bool updateSingleRecordImpl(hash<auto> set, hash<auto> where_cond, *hash<auto> search_options);
265 public:
266 
267 
269 
278 protected:
279  int updateRecordsImpl(hash<auto> set, *hash<auto> where_cond, *hash<auto> search_options);
280 public:
281 
282 
284 
295 protected:
296  int deleteRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
297 public:
298 
299 
301 protected:
302  hash<DataProviderInfo> getStaticInfoImpl();
303 public:
304 
305 
307  int doSequenceKey(string sequence_name);
308 
309 
311  int doSequenceCurrvalKey(string sequence_name);
312 
313 };
314 };
Defines a data provider based on a single SQL table.
Definition: DbTableDataProvider.qc.dox.h:28
*hash< string, AbstractDataField > getRecordTypeImpl(*hash< auto > search_options)
Returns the description of the record type, if any.
string getName()
Returns the data provider name.
*AbstractDataProvider getChildProviders()
Returns child providers; return NOTHING if there are no child providers.
beginTransaction()
Begins a transaction in the datasource underlying the table.
const MapperKeyInfo
Mapper runtime key info; see details below.
Definition: DbTableDataProvider.qc.dox.h:41
const DbUpsertMap
Maps SqlUtil Upsert Result Codes to DB Provider Upsert Result Codes.
Definition: DbTableDataProvider.qc.dox.h:100
commit()
Commits data written to the data provider.
const ProviderInfo
Provider info.
Definition: DbTableDataProvider.qc.dox.h:32
string upsertRecordImpl(hash< auto > rec, *hash< auto > upsert_options)
Upserts the given record to the data provider.
int doSequenceCurrvalKey(string sequence_name)
Processes the sequence_currval runtime key in mappers.
const ConstructorOptions
Constructor options.
Definition: DbTableDataProvider.qc.dox.h:45
bool updateSingleRecordImpl(hash< auto > set, hash< auto > where_cond, *hash< auto > search_options)
Updates a single record matching the search options.
const SearchOptions
Search options; see details below.
Definition: DbTableDataProvider.qc.dox.h:96
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
DbTableRecordIterator searchRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options.
const CreateOptions
Create options; see details below.
Definition: DbTableDataProvider.qc.dox.h:58
int doSequenceKey(string sequence_name)
Processes the sequence runtime key in mappers.
*hash< auto > searchSingleRecordImpl(hash< auto > where_cond, *hash< auto > search_options)
Returns a single record matching the search options.
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.
AbstractDatabase db
the database object, if required
Definition: DbTableDataProvider.qc.dox.h:108
AbstractDataProviderBulkOperation getBulkUpserter()
Returns a bulk upsert operation object for the data provider.
int deleteRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Deletes zero or more records.
AbstractTable table
the table
Definition: DbTableDataProvider.qc.dox.h:105
constructor(*hash< auto > options)
Creates the object from constructor options.
*hash< auto > createRecordImpl(hash< auto > rec, *hash< auto > create_options)
Writes the given record to the data provider.
constructor(AbstractTable table)
Creates the object.
const UpsertOptions
Upsert options; see details below.
Definition: DbTableDataProvider.qc.dox.h:69
rollback()
Rolls back data written to the data provider.
bool requiresTransactionManagement()
Returns True if the data provider supports transaction management.
*hash< string, hash< MapperRuntimeKeyInfo > > getMapperRuntimeKeys()
Returns custom data mapper runtime keys.
int updateRecordsImpl(hash< auto > set, *hash< auto > where_cond, *hash< auto > search_options)
Updates zero or more records matching the search options.
AbstractDataProviderBulkOperation getBulkInserter()
Returns a bulk insert operation object for the data provider.
Defines the record iterator class for Table-based iterators.
Definition: DbTableRecordIterator.qc.dox.h:34
Qore AbstractDbRecordIterator class definition.
Definition: AbstractDbRecordIterator.qc.dox.h:32