SQLIStream Class ReferenceIStream implementation for SQL based archives.
More...
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Public Member Functions | |
| virtual void | close () |
| Close stream. | |
| virtual void | destroy () |
| Destroy stream. | |
| const ConvSpec & | getConversionSpecs () const |
| Get conversion specification used by this stream. | |
| virtual bool | getNext (Storeable *pObject) |
| Get next object from stream. | |
| const std::string & | getQuery () const |
| Get SQL query string created by stream after open(). | |
| virtual void | open (Storeable &pObject, const char *pMainTable=NULL) |
| Open stream for Storeable object. | |
| void | openFromQuery (Storeable &pObject, const SQL &pQuery, const char *pMainTable=NULL) |
| Open stream using SQL SELECT query instead of store tables. | |
| SQLIStream & | operator= (const SQLIStream &) |
| Assigment opearator increases internal DbConnection usage. | |
| DbResult * | sendQuery (const SQL &pQuery) const |
| Send SQL query to database and get results. | |
| virtual void | setWhereId (int pId) |
| Set WHERE to load only one object with given id. | |
| virtual void | setWherePart (const SQL &pQueryPart) |
| Set additional SQL WHERE to query that is sent to database. | |
| SQLIStream (const SQLIStream &pStream) | |
| Copy constructor increases internal DbConnection usage. | |
| virtual bool | updateVars () |
| Update binded vars but don't fill object passed to open() Must be called after open() and this method does not advance to next row in result. | |
Detailed Description
IStream implementation for SQL based archives.Member Function Documentation
| virtual void destroy | ( | ) | [virtual] |
Destroy stream.
After call to this function stream is destroyed and cannot be opened any more. It usually means that connection to database that this stream represents is closed after this method was called
Implements Stream.
| const ConvSpec& getConversionSpecs | ( | ) | const |
Get conversion specification used by this stream.
- Returns:
- conversion specifications
| virtual bool getNext | ( | Storeable * | pObject | ) | [virtual] |
Get next object from stream.
- Parameters:
-
pObject object to be updated from stream
- Returns:
- true if object was retrieved or false if there is no more data in stream
Implements IStream.
| virtual void open | ( | Storeable & | pObject, | |
| const char * | pMainTable = NULL | |||
| ) | [virtual] |
Open stream using SQL SELECT query instead of store tables.
Returned columns should match all store table fields from all store tables for pObject and binded variables. If there is no field for store table entry then member will not be modified when data is retrieved.
- Parameters:
-
pObject object type for stream preparation pQuery SQL query. pMainTable custom name of object root store table
Send SQL query to database and get results.
Must be called before open or openFromQuery
- Parameters:
-
pQuery query to send.
| virtual void setWhereId | ( | int | pId | ) | [virtual] |
Set WHERE to load only one object with given id.
Must be called before open or openFromQuery
- Parameters:
-
pId id of object to load
| virtual void setWherePart | ( | const SQL & | pQueryPart | ) | [virtual] |
Set additional SQL WHERE to query that is sent to database.
Must be called before open()
- Parameters:
-
pQueryPart where part of SQL query (without WHERE word)
The documentation for this class was generated from the following file:
| Documentation |
|---|
| Quick start |
| Examples |
| API Documentation |
|---|
| Class hierarchy |
| Member index |
| API Reference |
| Store filters |
| Store table macros |
Generated by doxygen at Fri Oct 22 23:15:46 2010


