iopc::SimpleQuery Class Reference
[iopclib]

A query implementation that allows to filter and order persistent instances of a particular type. More...

#include <simpleQuery.h>

Inheritance diagram for iopc::SimpleQuery:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 SimpleQuery (std::string queryStr="", std::string sortStr="")
virtual std::string getSql (Driver &drv, const Type &type) const
 Returns SQL SELECT statement representing the current query.

Static Public Attributes

static SimpleQuery All
 A query retrieving all unordered persistent instances of a particular type.


Detailed Description

A query implementation that allows to filter and order persistent instances of a particular type.

SimpleQuery is used to create basic queries which select data only from a single view or table specified by the result type of the query result Result<T>. The result can be ordered and filtered by restricting attribute values of the type. SimpleQuery is used to retrieve instances of one particular type. It represents only the WHERE and ORDER BY parts of the resulting SQL SELECT statement.


Constructor & Destructor Documentation

iopc::SimpleQuery::SimpleQuery ( std::string  queryStr = "",
std::string  sortStr = "" 
) [inline]

Parameters:
queryStr Query filter which restricts attribute values of the queried type. May be empty. Example: "::Person::age > 30"
sortStr Describes how the results are ordered. May be empty Example:: "::Person::name ASC"
Both strings are substituted according to rules described in Query::substituteQuery()


Member Function Documentation

string SimpleQuery::getSql ( Driver drv,
const Type type 
) const [virtual]

Returns SQL SELECT statement representing the current query.

Parameters:
drv Database driver used to generate the statement
type Type for which to generate the statement. Determines the columns/attributes that the SELECT returns.

Implements iopc::Query.


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

Generated on Tue Apr 14 16:46:52 2009 for IOPC 2 by  doxygen 1.5.6