fintp_udal
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FinTP::DataCommand Class Reference

Command class implements objectual mapping of a database query. More...

#include <DataCommand.h>

Public Types

enum  COMMAND_TYPE { SP, INLINE, CURSOR }
 Database query type passed as a command type to be executed. More...
 
enum  QUERY_TYPE { QUERY, NONQUERY }
 

Public Member Functions

 DataCommand ()
 
 DataCommand (const DataCommand::COMMAND_TYPE commandType, const DataCommand::QUERY_TYPE queryType, const string &statementString, const bool cacheable=false, const string &modStatementString="")
 Constructor. More...
 
 DataCommand (const DataCommand &source)
 
DataCommandoperator= (const DataCommand &source)
 Assign operator. More...
 
 ~DataCommand ()
 DataCommand destructor. More...
 
DataCommand::COMMAND_TYPE getCommandType () const
 the command type More...
 
void setCommandType (const DataCommand::COMMAND_TYPE commandType)
 Set Command Type Method. More...
 
DataCommand::QUERY_TYPE getQueryType () const
 the query type More...
 
bool isQuery () const
 true if the DataCommand is a select query and false otherwise More...
 
void setQueryType (const DataCommand::QUERY_TYPE queryType)
 *Set query type More...
 
string getModifiedStatementString () const
 the modified statement string More...
 
void setModifiedStatementString (const string &modStatementString)
 *Set the modified statement string More...
 
string getStatementString () const
 
bool isCacheable () const
 the cacheable option More...
 
void setCacheable (const bool cacheable)
 the cacheable option More...
 
const DataColumnBasegetResultColumn (unsigned int index) const
 Get result set indexed column. More...
 
unsigned int getResultColumnCount () const
 
void addResultColumn (const unsigned int index, const DataColumnBase *column)
 Add a result column to m_ResultColumns. More...
 

Static Public Member Functions

static string ToString (COMMAND_TYPE type)
 Returns a friendly textual name of the COMMAND_TYPE values. More...
 

Private Attributes

DataCommand::COMMAND_TYPE m_CommandType
 
DataCommand::QUERY_TYPE m_QueryType
 
string m_StatementString
 The SQL statement string of a Command. More...
 
string m_ModifiedStatementString
 The modified SQL statement string of a Command m_Statement string ca be modified to reflect additional option sent along with the SQL statement to ExecuteQuery methods. More...
 
bool m_Cacheable
 True if command is cacheable. More...
 
CacheManager< unsigned int,
DataColumnBase
m_ResultColumns
 Data member provided to store result set columns description. More...
 

Detailed Description

Command class implements objectual mapping of a database query.

Every database query is parsed and stored in data member of this class If Command is cachable it will be retained in a Database cache for subsequent use

Member Enumeration Documentation

Database query type passed as a command type to be executed.

Enumerator
SP 

An enum constant representing the Stored Procedure option Command statement string is a stored procedure name.

INLINE 

An enum constant representing Query Statement option Command statement string is the actual query ( ex : select * from ...

)

CURSOR 

An enum constant representing the Cursor option Informix open a Cursor to execute Query Statement.

Note
Why not use QUERY with SP irespectiv INLINE options
Enumerator
QUERY 

Enum constant representing option of executing a query command ( select )

NONQUERY 

Enum constant representing the option of executing a nonquery command ( update, delete, insert )

Constructor & Destructor Documentation

DataCommand::DataCommand ( )
DataCommand::DataCommand ( const DataCommand::COMMAND_TYPE  commandType,
const DataCommand::QUERY_TYPE  queryType,
const string &  statementString,
const bool  cacheable = false,
const string &  modStatementString = "" 
)

Constructor.

Parameters
commandTypeType of the command.
queryTypeType of the query.
statementStringThe statement string.
cacheable(optional) true to cache Command.
modStatementString(optional) the modifier statement string.
DataCommand::DataCommand ( const DataCommand source)
DataCommand::~DataCommand ( )

DataCommand destructor.

Member Function Documentation

void FinTP::DataCommand::addResultColumn ( const unsigned int  index,
const DataColumnBase column 
)
inline

Add a result column to m_ResultColumns.

Parameters
typeint index position of the resultcolumn
typeDataColumnBase column to be added
DataCommand::COMMAND_TYPE FinTP::DataCommand::getCommandType ( ) const
inline

the command type

string FinTP::DataCommand::getModifiedStatementString ( ) const
inline

the modified statement string

DataCommand::QUERY_TYPE FinTP::DataCommand::getQueryType ( ) const
inline

the query type

const DataColumnBase& FinTP::DataCommand::getResultColumn ( unsigned int  index) const
inline

Get result set indexed column.

Parameters
intindex is the column position
Returns
the result column on the idex position
unsigned int FinTP::DataCommand::getResultColumnCount ( ) const
inline
Returns
result set column number
string FinTP::DataCommand::getStatementString ( ) const
inline
Returns
statement string
bool FinTP::DataCommand::isCacheable ( ) const
inline

the cacheable option

bool FinTP::DataCommand::isQuery ( ) const
inline

true if the DataCommand is a select query and false otherwise

DataCommand & DataCommand::operator= ( const DataCommand source)

Assign operator.

Parameters
sourceSource for the data command.
Returns
A shallow copy of this object.
void FinTP::DataCommand::setCacheable ( const bool  cacheable)
inline

the cacheable option

void FinTP::DataCommand::setCommandType ( const DataCommand::COMMAND_TYPE  commandType)
inline

Set Command Type Method.

void FinTP::DataCommand::setModifiedStatementString ( const string &  modStatementString)
inline

*Set the modified statement string

void FinTP::DataCommand::setQueryType ( const DataCommand::QUERY_TYPE  queryType)
inline

*Set query type

static string FinTP::DataCommand::ToString ( COMMAND_TYPE  type)
static

Returns a friendly textual name of the COMMAND_TYPE values.

Parameters
typeThe type of the command as defined by COMMAND_TYPE type
Returns
COMMAND_TYPE as a string.

Member Data Documentation

bool FinTP::DataCommand::m_Cacheable
private

True if command is cacheable.

Default value set by .ctor is false

DataCommand::COMMAND_TYPE FinTP::DataCommand::m_CommandType
private
string FinTP::DataCommand::m_ModifiedStatementString
private

The modified SQL statement string of a Command m_Statement string ca be modified to reflect additional option sent along with the SQL statement to ExecuteQuery methods.

See Database::ExecuteQuery() Database::ExecuteNonQuery()

DataCommand::QUERY_TYPE FinTP::DataCommand::m_QueryType
private
CacheManager< unsigned int, DataColumnBase > FinTP::DataCommand::m_ResultColumns
private

Data member provided to store result set columns description.

string FinTP::DataCommand::m_StatementString
private

The SQL statement string of a Command.


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