Static Public Member Functions

Wt::Dbo::sql_result_traits< Result > Class Template Reference
[Database Objects library (Dbo)]

Traits class for result types. More...

#include <Wt/Dbo/SqlTraits>

List of all members.

Static Public Member Functions

static std::string getColumns (Session &session, std::vector< std::string > *aliases)
 Returns a string that contains the result columns.
static Result loadValues (Session &session, SqlStatement &statement, int &column)
 Reads a result from an executed query.

Detailed Description

template<typename Result>
class Wt::Dbo::sql_result_traits< Result >

Traits class for result types.

This traits class may be used to add support for using classes or structs as a result for a Session::query().

The library provides by default support for primitive types, using sql_value_traits, mapped objects held by ptr types, and boost::tuple<> of any combination of these.

See also:
sql_value_traits, ptr

Member Function Documentation

template<typename Result >
std::string Wt::Dbo::sql_result_traits< Result >::getColumns ( Session session,
std::vector< std::string > *  aliases 
) [static]

Returns a string that contains the result columns.

This should return a fragment for an SQL SELECT statement that returns the columns corresponding to this result type.

It may consume any number of the given aliases (popping values from the front of this vector), and should throw an exception if not enough aliases were provided by the user.

template<typename Result >
Result Wt::Dbo::sql_result_traits< Result >::loadValues ( Session session,
SqlStatement statement,
int &  column 
) [static]

Reads a result from an executed query.

This should read the value from the statement, starting at column column, and advancing the column pointer for as many columns as needed (and according to the number of columns returned by getColumns().


Generated on Mon Nov 29 2010 08:03:20 for Wt by doxygen 1.7.1