#include <Wt/Dbo/SqlTraits>
Static Public Member Functions | |
static void | getFields (Session &session, std::vector< std::string > *aliases, std::vector< FieldInfo > &result) |
Obtains the list of fields in this result. | |
static Result | load (Session &session, SqlStatement &statement, int &column) |
Reads a result from an executed query. | |
static void | getValues (const Result &result, std::vector< boost::any > &values) |
Returns result values. |
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.
void Wt::Dbo::query_result_traits< Result >::getFields | ( | Session & | session, | |
std::vector< std::string > * | aliases, | |||
std::vector< FieldInfo > & | result | |||
) | [inline, static] |
Obtains the list of fields in this result.
This is used to build the select clause of an Sql query.
The given aliases
may be used to qualify fields that correspond to entire tables (popping values from the front of this vector). An exception is thrown if not enough aliases were provided.
Result Wt::Dbo::query_result_traits< Result >::load | ( | Session & | session, | |
SqlStatement & | statement, | |||
int & | column | |||
) | [inline, static] |
Reads a result from an executed query.
This reads 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 fields returned by getFields()).
void Wt::Dbo::query_result_traits< Result >::getValues | ( | const Result & | result, | |
std::vector< boost::any > & | values | |||
) | [inline, static] |
Returns result values.
This returns the individual field values in the given result
.