Changeset 91
- Timestamp:
- 01/21/08 20:33:51 (1 year ago)
- Files:
-
- branches/debea_1_2/dba/dba/csv.h (modified) (1 diff)
- branches/debea_1_2/dba/dba/database.h (modified) (3 diffs)
- branches/debea_1_2/dba/dba/dbupdate.h (modified) (1 diff)
- branches/debea_1_2/dba/dba/exception.h (modified) (1 diff)
- branches/debea_1_2/dba/dba/idlocker.h (modified) (1 diff)
- branches/debea_1_2/dba/dba/istream.h (modified) (2 diffs)
- branches/debea_1_2/dba/dba/ostream.h (modified) (2 diffs)
- branches/debea_1_2/dba/dba/sharedsqlarchive.h (modified) (1 diff)
- branches/debea_1_2/dba/dba/single.h (modified) (1 diff)
- branches/debea_1_2/dba/dba/stddeque.h (modified) (1 diff)
- branches/debea_1_2/dba/dba/stdset.h (modified) (1 diff)
- branches/debea_1_2/dba/dba/stdvector.h (modified) (1 diff)
- branches/debea_1_2/dba/docs/dba.doxyfile (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/debea_1_2/dba/dba/csv.h
r90 r91 328 328 virtual void destroy(); 329 329 //csv format does not support transactions 330 /** 331 For CSV file format this method does nothing 332 */ 330 333 virtual void begin() {}; 334 /** 335 For CSV file format this method does nothing 336 */ 331 337 virtual void commit() {}; 338 /** 339 For CSV file format this method does nothing 340 */ 332 341 virtual void rollback() {}; 333 342 /** branches/debea_1_2/dba/dba/database.h
r90 r91 271 271 272 272 /** 273 This class represents result of executed query by callins DbConnection.sendQuery() 274 It allows to discover column names and get data from database as one of four types 275 specified in Database::StoreType enum 273 This class represents result of SQL query. 274 It allows to discover column names and get data from database as one of four C types. 276 275 @ingroup api 277 276 */ … … 282 281 */ 283 282 static const struct tm sInvalidTm; 284 /** 285 @return number of columns in result. Columns are numbered from zero 283 /** @name Dataset operations 284 */ 285 //@{ 286 /** 287 Get number of columns. 288 @return number of columns in result. 286 289 */ 287 290 virtual int columns() const = 0; 288 291 /** 289 @param pIndex number of column (in query order) 292 Get column description. 293 @param pIndex number of column (in query order), starting from zero. 290 294 @return i-th column description. 291 295 */ 292 296 virtual const DbColumn& getColumn(int pIndex) const = 0; 293 297 /** 294 Those functions returns data from current row converting internal data representation 295 to return data type. Field in row can be specified using column index or field name. 296 Column index starts from zero. 297 */ 298 //@{ 299 /** 300 Get field as string value 301 @param pField field name 302 */ 303 const char* getString(const char* pField) const { return getString(getColumnIndex(pField)); } 304 /** 305 Get field as string value 306 @param pField field index 307 */ 308 const char* getString(int pField) const; 309 /** 310 Get field as int value 311 @param pField field name 312 */ 313 long getInt(const char* pField) const { return getInt(getColumnIndex(pField)); } 314 /** 315 Get field as int value 316 @param pField field index 317 */ 318 long getInt(int pField) const; 319 /** 320 Get field as double value 321 @param pField field name 322 */ 323 double getDouble(const char* pField) const { return getDouble(getColumnIndex(pField)); } 324 /** 325 Get field as double value 326 @param pField field index 327 */ 328 double getDouble(int pField) const; 329 /** 330 Get field as date value 331 @param pField field name 332 */ 333 struct tm getDate(const char* pField) const { return getDate(getColumnIndex(pField)); } 334 /** 335 Get field as date value 336 @param pField field index 337 */ 338 struct tm getDate(int pField) const; 339 /** 340 Check if field contains null value 341 @param pField field name 342 @return true if field is null, false otherwise 343 */ 344 bool isNull(const char* pField) const { return doCheckNull(getColumnIndex(pField)); } 345 /** 346 Check if field contains null value 347 @param pField field index 348 @return true if field is null, false otherwise 349 */ 350 bool isNull(int pField) const { return doCheckNull(pField); } 351 //@} 352 /** 353 Cancel query processing. This operation can be one only once for DbResult 298 Cancel query processing. This operation can be one only once for DbResult and currently is supported for ODBC driver only. 354 299 */ 355 300 virtual void cancel() {}; … … 361 306 */ 362 307 virtual bool fetchRow() = 0; 308 //@} 309 /** @name Data Access 310 Those functions returns data from current row converting internal data representation 311 to return data type. Field in row can be specified using column index or field name. 312 Column index starts from zero. If SQL type that driver returned is different from 313 returned type, then SQL type is converted to type to return. If conversion fails, then 314 DataException is thrown. 315 */ 316 //@{ 317 /** 318 Get field as string value 319 @param pField field name 320 */ 321 const char* getString(const char* pField) const { return getString(getColumnIndex(pField)); } 322 /** 323 Get field as string value 324 @param pField field index 325 */ 326 const char* getString(int pField) const; 327 /** 328 Get field as int value 329 @param pField field name 330 */ 331 long getInt(const char* pField) const { return getInt(getColumnIndex(pField)); } 332 /** 333 Get field as int value 334 @param pField field index 335 */ 336 long getInt(int pField) const; 337 /** 338 Get field as double value 339 @param pField field name 340 */ 341 double getDouble(const char* pField) const { return getDouble(getColumnIndex(pField)); } 342 /** 343 Get field as double value 344 @param pField field index 345 */ 346 double getDouble(int pField) const; 347 /** 348 Get field as date value 349 @param pField field name 350 */ 351 struct tm getDate(const char* pField) const { return getDate(getColumnIndex(pField)); } 352 /** 353 Get field as date value 354 @param pField field index 355 */ 356 struct tm getDate(int pField) const; 357 /** 358 Check if field contains null value 359 @param pField field name 360 @return true if field is null, false otherwise 361 */ 362 bool isNull(const char* pField) const { return doCheckNull(getColumnIndex(pField)); } 363 /** 364 Check if field contains null value 365 @param pField field index 366 @return true if field is null, false otherwise 367 */ 368 bool isNull(int pField) const { return doCheckNull(pField); } 369 //@} 363 370 virtual ~DbResult() {}; 364 371 protected: branches/debea_1_2/dba/dba/dbupdate.h
r47 r91 23 23 database schema update. This interface allows progress bar implementation for 24 24 derived classes. 25 @ingroup api 25 26 This interface requires SQL table db_version to exists in database with following schema: 27 @code 28 CREATE TABLE db_version ( 29 version VARCHAR(128) 30 ); 31 @endcode 32 @ingroup api 26 33 */ 27 34 class dbaDLLEXPORT DbUpdate { branches/debea_1_2/dba/dba/exception.h
r90 r91 72 72 73 73 /** 74 Base class for exceptions thrown when daba from database is manipulated 75 - for example conversion from string to int failed, bad sql query was executed 74 75 Base class for exceptions thrown when daba from database is manipulated, 76 for example conversion from string to int failed, bad sql query was executed 76 77 or parser could not parse corrupted csv file. 77 78 @ingroup api branches/debea_1_2/dba/dba/idlocker.h
r73 r91 14 14 15 15 /** 16 Helper class to lock id of object when using assig nemt operator16 Helper class to lock id of object when using assigment operator 17 17 18 18 Id of all objects are locked until at least one locker exists, so this object should be created only on stack. branches/debea_1_2/dba/dba/istream.h
r36 r91 31 31 Then you want to get variables first, find referenced objects and and then create object using 32 32 getNext(). 33 34 As getNext is useful when fetching single Storeable objects, you can use get() to load 35 particular Storeable derived object and all subobjects that are specified using BIND_COL 36 or BIND_CLA macros. 33 37 34 38 You can open stream by using Stream::open() method. … … 88 92 configure stream to open for records that have one of values from array 89 93 in field named pFKeyName. Used by getChildren to retrieve reference data 90 for BIND_COL collections 94 for BIND_COL collections. 91 95 @param pFKeyName name of foreign key field 92 96 @param pRelationId collection identification from BIND_CLA or Storeable::Invalid if not used branches/debea_1_2/dba/dba/ostream.h
r20 r91 33 33 /** 34 34 Commit all changes made to stream from point where begin() was called. 35 @note You should use dba::Transaction object instead of calling this method 35 36 */ 36 37 virtual void commit() = 0; 37 38 /** 38 39 Cancel all changes to stream from point where begin() was called. 40 @note You should use dba::Transaction object instead of calling this method 39 41 */ 40 42 virtual void rollback() = 0; … … 43 45 in database that are affected by putting pObject. 44 46 45 Depending on state of pObject store, erase or update is called 47 Depending on state of pObject store, erase or update is called. 48 @note You should use dba::Transaction object instead of calling this method 46 49 @param pObject object to store 47 50 */ branches/debea_1_2/dba/dba/sharedsqlarchive.h
r79 r91 29 29 */ 30 30 typedef enum { 31 TRANS_USE_LAST, //! create childtransaction32 TRANS_NEW //! create new transaction31 TRANS_USE_LAST, //!<create child of last existing transaction 32 TRANS_NEW //!<create new transaction 33 33 } creationType; 34 34 /** branches/debea_1_2/dba/dba/single.h
r73 r91 31 31 Storeable& mObject; 32 32 }; 33 /** 34 Constructor 35 @param pObj object to be updated 36 */ 33 37 Single(Storeable& pObj) : CollectionFilter<Storeable>(pObj) {}; 34 38 virtual CollectionFilterIterator* createIterator() const { return new iterator(*mMember); }; branches/debea_1_2/dba/dba/stddeque.h
r48 r91 47 47 /** 48 48 Constructor 49 @param p Listobject that will be modified by filter49 @param pDeque object that will be modified by filter 50 50 */ 51 51 stdDeque(std::deque<T>& pDeque) : InstanceFilter<std::deque<T>, T>(pDeque) {}; branches/debea_1_2/dba/dba/stdset.h
r48 r91 50 50 /** 51 51 Constructor 52 @param p List object that will be modified by filter52 @param pSet object that will be modified by filter 53 53 */ 54 54 stdSet(std::set<T>& pSet) : InstanceFilter<std::set<T>, T>(pSet) {}; branches/debea_1_2/dba/dba/stdvector.h
r48 r91 47 47 /** 48 48 Constructor 49 @param p Listobject that will be modified by filter49 @param pVector object that will be modified by filter 50 50 */ 51 stdVector(std::vector<T>& p Set) : InstanceFilter<std::vector<T>, T>(pSet) {};51 stdVector(std::vector<T>& pVector) : InstanceFilter<std::vector<T>, T>(pVector) {}; 52 52 virtual CollectionFilterIterator* createIterator() const { return new iterator(*mMember); }; 53 53 virtual void clear() { mMember->clear(); }; branches/debea_1_2/dba/docs/dba.doxyfile
r14 r91 130 130 $(SRCDIR)/dba/double_filter.h \ 131 131 $(SRCDIR)/dba/exception.h \ 132 $(SRCDIR)/dba/genericfetcher.h \ 132 133 $(SRCDIR)/dba/idlocker.h \ 133 134 $(SRCDIR)/dba/int_filter.h \ … … 137 138 $(SRCDIR)/dba/plugininfo.h \ 138 139 $(SRCDIR)/dba/sharedsqlarchive.h \ 140 $(SRCDIR)/dba/single.h \ 139 141 $(SRCDIR)/dba/sqlarchive.h \ 142 $(SRCDIR)/dba/sqlidfetcher.h \ 143 $(SRCDIR)/dba/sqlistream.h \ 144 $(SRCDIR)/dba/sqlostream.h \ 140 145 $(SRCDIR)/dba/sqlutils.h \ 141 146 $(SRCDIR)/dba/stdfilters.h \ 147 $(SRCDIR)/dba/stddeque.h \ 142 148 $(SRCDIR)/dba/stdlist.h \ 149 $(SRCDIR)/dba/stdmultiset.h \ 150 $(SRCDIR)/dba/stdset.h \ 143 151 $(SRCDIR)/dba/stlutils.h \ 152 $(SRCDIR)/dba/stdvector.h \ 144 153 $(SRCDIR)/dba/storeable.h \ 145 154 $(SRCDIR)/dba/storeablefilter.h \ 146 $(SRCDIR)/dba/storeablelist.h \147 155 $(SRCDIR)/dba/string_filter.h \ 148 156 $(SRCDIR)/dba/stream.h
