TreeFrogFramework  2.8
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 (const QSqlDatabase &db)
 
TSqlQueryprepare (const QString &query)
 
bool load (const QString &filename)
 
bool loadPreparedQuery (const QString &filename)
 
TSqlQuerybind (const QString &placeholder, const QVariant &val)
 
TSqlQuerybind (int pos, const QVariant &val)
 
TSqlQueryaddBind (const QVariant &val)
 
QVariant boundValue (int pos) const
 
QVariantList boundValues () const
 
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
 
QVariant value (const QString &name) 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, const QMetaType &type, int databaseId=0)
 
static QString formatValue (const QVariant &val, const QMetaType &type, const QSqlDatabase &database)
 
static QString formatValue (const QVariant &val, const QMetaType &type, const QSqlDriver *driver)
 
static QString formatValue (const QVariant &val, const QSqlDriver *driver)
 
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

◆ TSqlQueryORMapper()

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

◆ addBind()

template<class T >
TSqlQueryORMapper< T > & TSqlQueryORMapper< T >::addBind ( const QVariant &  val)
inline

◆ begin()

template<class T >
ConstIterator TSqlQueryORMapper< T >::begin ( )
inline

◆ bind() [1/2]

template<class T >
TSqlQueryORMapper< T > & TSqlQueryORMapper< T >::bind ( const QString &  placeholder,
const QVariant &  val 
)
inline

◆ bind() [2/2]

template<class T >
TSqlQueryORMapper< T > & TSqlQueryORMapper< T >::bind ( int  pos,
const QVariant &  val 
)
inline

◆ end()

template<class T >
ConstIterator TSqlQueryORMapper< T >::end ( )
inline

◆ exec() [1/2]

template<class T >
bool TSqlQueryORMapper< T >::exec
inline

◆ exec() [2/2]

template<class T >
bool TSqlQueryORMapper< T >::exec ( const QString &  query)
inline

◆ execFirst() [1/2]

template<class T >
T TSqlQueryORMapper< T >::execFirst
inline

◆ execFirst() [2/2]

template<class T >
T TSqlQueryORMapper< T >::execFirst ( const QString &  query)
inline

◆ fieldName()

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.

◆ load()

template<class T >
bool TSqlQueryORMapper< T >::load ( const QString &  filename)
inline

◆ next()

template<class T >
bool TSqlQueryORMapper< T >::next
inline

◆ numRowsAffected()

template<class T >
int TSqlQueryORMapper< T >::numRowsAffected
inline

◆ prepare()

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.

◆ size()

template<class T >
int TSqlQueryORMapper< T >::size
inline

◆ value()

template<class T >
T TSqlQueryORMapper< T >::value
inline

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


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