SQLIStream Class Reference
[Public API]

IStream implementation for SQL based archives. More...

#include <sqlistream.h>

Inheritance diagram for SQLIStream:

Inheritance graph
[legend]
Collaboration diagram for SQLIStream:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void close ()
 Close stream.
virtual void destroy ()
 Destroy stream.
const ConvSpecgetConversionSpecs () 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 created by stream after open().
virtual void open (Storeable &pObject, const char *pMainTable=NULL)
 Open stream for Storeable object.
void openFromQuery (Storeable &pObject, const char *pQuery, const char *pMainTable=NULL)
 Open stream using SQL SELECT query instead of store tables.
SQLIStreamoperator= (const SQLIStream &)
 Assigment opearator increases internal DbConnection usage.
DbResultsendQuery (const char *const 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 std::string &pWhere)
 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 void open Storeable pObject,
const char *  pMainTable = NULL
[virtual]
 

Open stream for Storeable object.

Parameters:
pObject object type for stream preparation
pMainTable custom name of pObject root store table

Reimplemented from Stream.

void openFromQuery Storeable pObject,
const char *  pQuery,
const char *  pMainTable = NULL
 

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

DbResult* sendQuery const char *const   pQuery  )  const
 

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 std::string &  pWhere  )  [virtual]
 

Set additional SQL WHERE to query that is sent to database.

Must be called before open()

Parameters:
pWhere where part of SQL query (without WHERE word)

The documentation for this class was generated from the following file:

Documentation
Quick start
Examples
Search

API Documentation
Class hierarchy
Member index
API Reference
Store filters
Store table macros
Back

Generated by doxygen at Sun Nov 9 02:08:26 2008