All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::sqlite::PreparedQuery Class Reference

A class that implements a prepared query for the TerraLib SQLite Data Access Driver. More...

#include <PreparedQuery.h>

Inheritance diagram for te::sqlite::PreparedQuery:
te::da::PreparedQuery

Public Member Functions

void bind (int i, char value)
 Binds the i-th parameter of the query to a value. More...
 
void bind (int i, unsigned char value)
 Binds the i-th parameter of the query to a value. More...
 
void bind (int i, boost::int16_t value)
 Binds the i-th parameter of the query to a value. More...
 
void bind (int i, boost::int32_t value)
 Binds the i-th parameter of the query to a value. More...
 
void bind (int i, boost::int64_t value)
 Binds the i-th parameter of the query to a value. More...
 
void bind (int i, bool value)
 Binds the i-th parameter of the query to a value. More...
 
void bind (int i, float value)
 Binds the i-th parameter of the query to a value. More...
 
void bind (int i, double value)
 Binds the i-th parameter of the query to a value. More...
 
void bind (int i, const std::string &value)
 Binds the i-th parameter of the query to a value. More...
 
void bind (int i, const te::dt::ByteArray &value)
 Binds the i-th parameter of the query to a value. More...
 
void bind (int i, const te::gm::Geometry &value)
 Binds the i-th parameter of the query to a value. More...
 
void bind (int i, const te::rst::Raster &value)
 Binds the i-th parameter of the query to a value. More...
 
void bind (int i, const te::dt::DateTime &value)
 Binds the i-th parameter of the query to a value. More...
 
void bind (int i, const te::da::DataSet &value)
 Binds the i-th parameter of the query to a value. More...
 
void bind (int i, const te::dt::AbstractData &ad)
 Binds the i-th parameter of the query to a value. More...
 
void bind (const std::vector< std::size_t > &propertiesPos, std::size_t offset, te::da::DataSet *d)
 
void bind (const std::vector< std::size_t > &propertiesPos, te::da::DataSet *d)
 
void bind (te::da::DataSet *d)
 
void bindNumeric (int i, const std::string &value)
 Binds the i-th parameter of the query to a value. More...
 
void execute ()
 
std::string getName () const
 It returns the prepared query name. More...
 
te::da::DataSourceTransactorgetTransactor () const
 It returns a pointer to the underlying data source transactor. More...
 
void prepare (const te::da::Query &query, const std::vector< te::dt::Property * > &paramTypes)
 It prepares the query that may be used for commands that are used mutiple times (select, insert, update and delete). More...
 
void prepare (const std::string &query, const std::vector< te::dt::Property * > &paramTypes)
 It prepares the query using native dialect. More...
 
void prepare (const std::string &query)
 
 PreparedQuery (DataSourceTransactor *parent, sqlite3 *db)
 
te::da::DataSetquery (te::common::TraverseType travType=te::common::FORWARDONLY, te::common::AccessPolicy rwRole=te::common::RAccess)
 
 ~PreparedQuery ()
 Virtual destructor. More...
 

Private Attributes

sqlite3m_db
 
sqlite3_stmtm_stmt
 
DataSourceTransactorm_t
 

Detailed Description

A class that implements a prepared query for the TerraLib SQLite Data Access Driver.

See also
te::da::PreparedQuery

Definition at line 68 of file PreparedQuery.h.

Constructor & Destructor Documentation

te::sqlite::PreparedQuery::PreparedQuery ( DataSourceTransactor parent,
sqlite3 db 
)

Definition at line 179 of file PreparedQuery.cpp.

te::sqlite::PreparedQuery::~PreparedQuery ( )
virtual

Virtual destructor.

Reimplemented from te::da::PreparedQuery.

Definition at line 186 of file PreparedQuery.cpp.

Member Function Documentation

void te::sqlite::PreparedQuery::bind ( int  i,
char  value 
)
virtual

Binds the i-th parameter of the query to a value.

Parameters
iThe parameter index.
valueThe parameter value.

Implements te::da::PreparedQuery.

Definition at line 303 of file PreparedQuery.cpp.

void te::sqlite::PreparedQuery::bind ( int  i,
unsigned char  value 
)
virtual

Binds the i-th parameter of the query to a value.

Parameters
iThe parameter index.
valueThe parameter value.

Implements te::da::PreparedQuery.

Definition at line 311 of file PreparedQuery.cpp.

void te::sqlite::PreparedQuery::bind ( int  i,
boost::int16_t  value 
)
virtual

Binds the i-th parameter of the query to a value.

Parameters
iThe parameter index.
valueThe parameter value.

Implements te::da::PreparedQuery.

Definition at line 319 of file PreparedQuery.cpp.

void te::sqlite::PreparedQuery::bind ( int  i,
boost::int32_t  value 
)
virtual

Binds the i-th parameter of the query to a value.

Parameters
iThe parameter index.
valueThe parameter value.

Implements te::da::PreparedQuery.

Definition at line 327 of file PreparedQuery.cpp.

void te::sqlite::PreparedQuery::bind ( int  i,
boost::int64_t  value 
)
virtual

Binds the i-th parameter of the query to a value.

Parameters
iThe parameter index.
valueThe parameter value.

Implements te::da::PreparedQuery.

Definition at line 335 of file PreparedQuery.cpp.

void te::sqlite::PreparedQuery::bind ( int  i,
bool  value 
)
virtual

Binds the i-th parameter of the query to a value.

Parameters
iThe parameter index.
valueThe parameter value.

Implements te::da::PreparedQuery.

Definition at line 343 of file PreparedQuery.cpp.

References TE_SQLITE_BOOL_FALSE, and TE_SQLITE_BOOL_TRUE.

void te::sqlite::PreparedQuery::bind ( int  i,
float  value 
)
virtual

Binds the i-th parameter of the query to a value.

Parameters
iThe parameter index.
valueThe parameter value.

Implements te::da::PreparedQuery.

Definition at line 351 of file PreparedQuery.cpp.

void te::sqlite::PreparedQuery::bind ( int  i,
double  value 
)
virtual

Binds the i-th parameter of the query to a value.

Parameters
iThe parameter index.
valueThe parameter value.

Implements te::da::PreparedQuery.

Definition at line 359 of file PreparedQuery.cpp.

void te::sqlite::PreparedQuery::bind ( int  i,
const std::string &  value 
)
virtual

Binds the i-th parameter of the query to a value.

Parameters
iThe parameter index.
valueThe parameter value.

Implements te::da::PreparedQuery.

Definition at line 375 of file PreparedQuery.cpp.

void te::sqlite::PreparedQuery::bind ( int  i,
const te::dt::ByteArray value 
)
virtual

Binds the i-th parameter of the query to a value.

Parameters
iThe parameter index.
valueThe parameter value.

Implements te::da::PreparedQuery.

Definition at line 383 of file PreparedQuery.cpp.

References te::dt::ByteArray::bytesUsed(), and te::dt::ByteArray::getData().

void te::sqlite::PreparedQuery::bind ( int  i,
const te::gm::Geometry value 
)
virtual

Binds the i-th parameter of the query to a value.

Parameters
iThe parameter index.
valueThe parameter value.

Implements te::da::PreparedQuery.

Definition at line 391 of file PreparedQuery.cpp.

References te::sqlite::EWKBSize::getEWKBSize(), and te::common::Globals::sm_machineByteOrder.

void te::sqlite::PreparedQuery::bind ( int  i,
const te::rst::Raster value 
)
virtual

Binds the i-th parameter of the query to a value.

Parameters
iThe parameter index.
valueThe parameter value.

Implements te::da::PreparedQuery.

Definition at line 407 of file PreparedQuery.cpp.

void te::sqlite::PreparedQuery::bind ( int  i,
const te::dt::DateTime value 
)
virtual

Binds the i-th parameter of the query to a value.

Parameters
iThe parameter index.
valueThe parameter value.

Implements te::da::PreparedQuery.

Definition at line 412 of file PreparedQuery.cpp.

References te::dt::AbstractData::toString().

void te::sqlite::PreparedQuery::bind ( int  i,
const te::da::DataSet value 
)
virtual

Binds the i-th parameter of the query to a value.

Parameters
iThe parameter index.
valueThe parameter value.

Implements te::da::PreparedQuery.

Definition at line 422 of file PreparedQuery.cpp.

void te::sqlite::PreparedQuery::bind ( int  i,
const te::dt::AbstractData ad 
)
virtual

Binds the i-th parameter of the query to a value.

Parameters
iThe parameter index.
valueThe parameter value.

Reimplemented from te::da::PreparedQuery.

Definition at line 427 of file PreparedQuery.cpp.

void te::sqlite::PreparedQuery::bind ( const std::vector< std::size_t > &  propertiesPos,
std::size_t  offset,
te::da::DataSet d 
)

Definition at line 461 of file PreparedQuery.cpp.

References te::sqlite::BindValue().

void te::sqlite::PreparedQuery::bind ( const std::vector< std::size_t > &  propertiesPos,
te::da::DataSet d 
)

Definition at line 471 of file PreparedQuery.cpp.

References te::sqlite::BindValue().

void te::sqlite::PreparedQuery::bind ( te::da::DataSet d)
void te::sqlite::PreparedQuery::bindNumeric ( int  i,
const std::string &  value 
)
virtual

Binds the i-th parameter of the query to a value.

Parameters
iThe parameter index.
valueThe parameter value.

Implements te::da::PreparedQuery.

Definition at line 367 of file PreparedQuery.cpp.

void te::sqlite::PreparedQuery::execute ( )
virtual

Implements te::da::PreparedQuery.

Definition at line 226 of file PreparedQuery.cpp.

std::string te::sqlite::PreparedQuery::getName ( ) const
virtual

It returns the prepared query name.

Parameters
returnThe prepared query name.

Implements te::da::PreparedQuery.

Definition at line 191 of file PreparedQuery.cpp.

te::da::DataSourceTransactor * te::sqlite::PreparedQuery::getTransactor ( ) const
virtual

It returns a pointer to the underlying data source transactor.

Returns
A pointer to the underlying data source transactor.

Implements te::da::PreparedQuery.

Definition at line 432 of file PreparedQuery.cpp.

void te::sqlite::PreparedQuery::prepare ( const te::da::Query query,
const std::vector< te::dt::Property * > &  paramTypes 
)
virtual

It prepares the query that may be used for commands that are used mutiple times (select, insert, update and delete).

This command will submit a request to create a prepared query with the given parameters.

Parameters
queryThe query to be prepared.
paramTypesThe list of parameters data type.
Exceptions
ExceptionIt throws an exception if the prepared query can not be created. For example if another prepared query with the same name already exists, this may throws an exception.

Implements te::da::PreparedQuery.

Definition at line 196 of file PreparedQuery.cpp.

References te::common::BaseVisitable< T, R >::accept().

void te::sqlite::PreparedQuery::prepare ( const std::string &  query,
const std::vector< te::dt::Property * > &  paramTypes 
)
virtual

It prepares the query using native dialect.

This command may be used for commands that are used mutiple times (select, insert, update and delete).

This command will submit a request to create a prepared query with the given parameters.

Parameters
queryThe query to be prepared.
paramTypesThe list of parameters data type.
Exceptions
ExceptionIt throws an exception if the prepared query can not be created. For example if another prepared query with the same name already exists, this may throws an exception.

Implements te::da::PreparedQuery.

Definition at line 207 of file PreparedQuery.cpp.

void te::sqlite::PreparedQuery::prepare ( const std::string &  query)

Definition at line 438 of file PreparedQuery.cpp.

te::da::DataSet * te::sqlite::PreparedQuery::query ( te::common::TraverseType  travType = te::common::FORWARDONLY,
te::common::AccessPolicy  rwRole = te::common::RAccess 
)
virtual

Implements te::da::PreparedQuery.

Definition at line 257 of file PreparedQuery.cpp.

Member Data Documentation

sqlite3* te::sqlite::PreparedQuery::m_db
private

Definition at line 133 of file PreparedQuery.h.

sqlite3_stmt* te::sqlite::PreparedQuery::m_stmt
private

Definition at line 132 of file PreparedQuery.h.

DataSourceTransactor* te::sqlite::PreparedQuery::m_t
private

Definition at line 131 of file PreparedQuery.h.


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