TreeFrogFramework  1.18
Classes | Public Member Functions | List of all members
TSqlQueryORMapper< T > Class Template Reference

#include <tsqlqueryormapper.h>

Inheritance diagram for TSqlQueryORMapper< T >:
Inheritance graph
[legend]
Collaboration diagram for TSqlQueryORMapper< T >:
Collaboration graph
[legend]

Classes

class  ConstIterator
 

Public Member Functions

 TSqlQueryORMapper (int databaseId=0)
 
TSqlQueryORMapper< T > & prepare (const QString &query)
 
bool load (const QString &filename)
 
TSqlQueryORMapper< T > & bind (const QString &placeholder, const QVariant &val)
 
TSqlQueryORMapper< T > & bind (int pos, const QVariant &val)
 
TSqlQueryORMapper< T > & addBind (const QVariant &val)
 
bool exec (const QString &query)
 
bool exec ()
 
execFirst (const QString &query)
 
execFirst ()
 
int numRowsAffected () const
 
int size () const
 
bool next ()
 
value () const
 
QString fieldName (int index) const
 
ConstIterator begin ()
 
ConstIterator end ()
 
- Public Member Functions inherited from TSqlQuery
 TSqlQuery (int databaseId=0)
 
 TSqlQuery (QSqlDatabase db)
 
TSqlQueryprepare (const QString &query)
 
bool load (const QString &filename)
 
TSqlQuerybind (const QString &placeholder, const QVariant &val)
 
TSqlQuerybind (int pos, const QVariant &val)
 
TSqlQueryaddBind (const QVariant &val)
 
QVariant getNextValue ()
 
QString queryDirPath () const
 
bool exec (const QString &query)
 
bool exec ()
 
int numRowsAffected () const
 
int size () const
 
bool next ()
 
QVariant value (int index) const
 

Additional Inherited Members

- Static Public Member Functions inherited from TSqlQuery
static void clearCachedQueries ()
 
static QString escapeIdentifier (const QString &identifier, QSqlDriver::IdentifierType type=QSqlDriver::FieldName, int databaseId=0)
 
static QString escapeIdentifier (const QString &identifier, QSqlDriver::IdentifierType type, const QSqlDriver *driver)
 
static QString formatValue (const QVariant &val, QVariant::Type type=QVariant::Invalid, int databaseId=0)
 
static QString formatValue (const QVariant &val, QVariant::Type type, const QSqlDatabase &database)
 
static QString formatValue (const QVariant &val, const QSqlDatabase &database)
 

Detailed Description

template<class T>
class TSqlQueryORMapper< T >

The TSqlQueryORMapper class is a template class that creates ORM objects by executing and manipulating SQL statements.

The TSqlQueryORMapper class is a template class that provides concise functionality to object-relational mapping by executing SQL statements.

It can be used to retrieve TSqlObject objects with SQL query from a table.

See also
TSqlQuery, TSqlObject

Constructor & Destructor Documentation

template<class T >
TSqlQueryORMapper< T >::TSqlQueryORMapper ( int  databaseId = 0)
inline

Constructs a TSqlQueryORMapper object using the SQL query and the database databaseId.

Constructs a TSqlQueryORMapper object using the database databaseId.

The query string must be to retrieve the ORM objects specified by the class T.

Member Function Documentation

template<class T >
TSqlQueryORMapper< T > & TSqlQueryORMapper< T >::addBind ( const QVariant &  val)
inline
template<class T>
ConstIterator TSqlQueryORMapper< T >::begin ( )
inline
template<class T >
TSqlQueryORMapper< T > & TSqlQueryORMapper< T >::bind ( const QString &  placeholder,
const QVariant &  val 
)
inline
template<class T >
TSqlQueryORMapper< T > & TSqlQueryORMapper< T >::bind ( int  pos,
const QVariant &  val 
)
inline
template<class T>
ConstIterator TSqlQueryORMapper< T >::end ( )
inline
template<class T >
bool TSqlQueryORMapper< T >::exec ( const QString &  query)
inline
template<class T >
bool TSqlQueryORMapper< T >::exec ( )
inline
template<class T >
T TSqlQueryORMapper< T >::execFirst ( const QString &  query)
inline
template<class T >
T TSqlQueryORMapper< T >::execFirst ( )
inline
template<class T >
QString TSqlQueryORMapper< T >::fieldName ( int  index) const
inline

Returns the name of the field at position index in the class T.

If the field does not exist, an empty string is returned.

template<class T >
bool TSqlQueryORMapper< T >::load ( const QString &  filename)
inline
template<class T >
bool TSqlQueryORMapper< T >::next ( )
inline
template<class T >
int TSqlQueryORMapper< T >::numRowsAffected ( ) const
inline
template<class T >
TSqlQueryORMapper< T > & TSqlQueryORMapper< T >::prepare ( const QString &  query)
inline

Prepares the SQL query query to retrieve the ORM objects specified by the class T.

template<class T >
int TSqlQueryORMapper< T >::size ( ) const
inline
template<class T >
T TSqlQueryORMapper< T >::value ( ) const
inline

Returns the current ORM object in the results retrieved by the query.


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