Qore DbDataProvider Module Reference  1.0
DbTableDataProvider.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
25 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 
141  commit();
142 
143 
145 
147  rollback();
148 
149 
151 
153  AbstractDataProviderBulkOperation getBulkInserter();
154 
155 
157 
159  AbstractDataProviderBulkOperation getBulkUpserter();
160 
161 
163 
165  *hash<string, hash<MapperRuntimeKeyInfo>> getMapperRuntimeKeys();
166 
167 
169 protected:
170  *hash<string, AbstractDataField> getRecordTypeImpl(*hash<auto> search_options);
171 public:
172 
173 
175 
183 protected:
184  *hash<auto> createRecordImpl(hash<auto> rec, *hash<auto> create_options);
185 public:
186 
187 
189 
197  string upsertRecordImpl(hash<auto> rec, *hash<auto> upsert_options);
198 
199 
201 
205 protected:
206  *hash<auto> searchSingleRecordImpl(hash<auto> where_cond, *hash<auto> search_options);
207 public:
208 
209 
211 
218 protected:
219  AbstractDataProviderBulkRecordInterface searchRecordsBulkImpl(int block_size = 1000, *hash<auto> where_cond, *hash<auto> search_options);
220 public:
221 
222 
224 
231 protected:
232  DbTableRecordIterator searchRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
233 public:
234 
235 
237 
246 protected:
247  bool updateSingleRecordImpl(hash<auto> set, hash<auto> where_cond, *hash<auto> search_options);
248 public:
249 
250 
252 
261 protected:
262  int updateRecordsImpl(hash<auto> set, *hash<auto> where_cond, *hash<auto> search_options);
263 public:
264 
265 
267 
278 protected:
279  int deleteRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
280 public:
281 
282 
284 protected:
285  hash<DataProviderInfo> getStaticInfoImpl();
286 public:
287 
288 
290  int doSequenceKey(string sequence_name);
291 
292 
294  int doSequenceCurrvalKey(string sequence_name);
295 
296 };
297 };
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
int doSequenceKey(string sequence_name)
Processes the sequence runtime key in mappers.
int doSequenceCurrvalKey(string sequence_name)
Processes the sequence_currval runtime key in mappers.
const ProviderInfo
Provider info.
Definition: DbTableDataProvider.qc.dox.h:32
int updateRecordsImpl(hash< auto > set, *hash< auto > where_cond, *hash< auto > search_options)
Updates zero or more records matching the search options.
*hash< string, hash< MapperRuntimeKeyInfo > > getMapperRuntimeKeys()
Returns custom data mapper runtime keys.
Defines a data provider based on a single SQL table.
Definition: DbTableDataProvider.qc.dox.h:28
commit()
Commits data written to the data provider.
int deleteRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Deletes zero or more records.
const MapperKeyInfo
Mapper runtime key info; see details below.
Definition: DbTableDataProvider.qc.dox.h:41
const SearchOptions
Search options; see details below.
Definition: DbTableDataProvider.qc.dox.h:96
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
bool requiresTransactionManagement()
Returns True if the data provider supports transaction management.
string upsertRecordImpl(hash< auto > rec, *hash< auto > upsert_options)
Upserts the given record to the data provider.
*AbstractDataProvider getChildProviders()
Returns child providers; return NOTHING if there are no child providers.
const UpsertOptions
Upsert options; see details below.
Definition: DbTableDataProvider.qc.dox.h:69
AbstractDatabase db
the database object, if required
Definition: DbTableDataProvider.qc.dox.h:108
AbstractTable table
the table
Definition: DbTableDataProvider.qc.dox.h:105
*hash< string, AbstractDataField > getRecordTypeImpl(*hash< auto > search_options)
Returns the description of the record type, if any.
const DbUpsertMap
Maps SqlUtil Upsert Result Codes to DB Provider Upsert Result Codes.
Definition: DbTableDataProvider.qc.dox.h:100
*hash< auto > searchSingleRecordImpl(hash< auto > where_cond, *hash< auto > search_options)
Returns a single record matching the search options.
rollback()
Rolls back data written to the data provider.
*hash< auto > createRecordImpl(hash< auto > rec, *hash< auto > create_options)
Writes the given record to the data provider.
DbTableRecordIterator searchRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options.
string getName()
Returns the data provider name.
const CreateOptions
Create options; see details below.
Definition: DbTableDataProvider.qc.dox.h:58
constructor(AbstractTable table)
Creates the object.
bool updateSingleRecordImpl(hash< auto > set, hash< auto > where_cond, *hash< auto > search_options)
Updates a single record matching the search options.
Qore AbstractDbRecordIterator class definition.
Definition: AbstractDbRecordIterator.qc.dox.h:32
AbstractDataProviderBulkOperation getBulkUpserter()
Returns a bulk upsert operation object for the data provider.
const ConstructorOptions
Constructor options.
Definition: DbTableDataProvider.qc.dox.h:45
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.