gSAFE  1.3.8
Public Slots | Signals | Public Member Functions | Public Attributes | List of all members
HDynTableSqlConnector Class Reference

#include <datalib.h>

Inheritance diagram for HDynTableSqlConnector:
HSqlHandler HSqlInterface HBase

Public Slots

int readSql (void)
 
int updateSql (void)
 

Signals

void justReaded (void)
 
void justUpdated (void)
 
- Signals inherited from HSqlHandler
void errorSignal (QString err)
 

Public Member Functions

 HDynTableSqlConnector (HDynTable *dynt, QString tablename, QString filterpart="")
 
void insertSql (QString additionaldefpart="", QString additionalvaluepart="")
 
QString sqlCreateString (QString switches="")
 
- Public Member Functions inherited from HSqlHandler
 HSqlHandler (void)
 
 ~HSqlHandler (void)
 
QSqlQuery * allocateQSqlQuery (void)
 
void cloneSqlSettingsFrom (HSqlHandler *other)
 
void commit (void)
 
bool errorStatus (void)
 
void rollback (void)
 
bool submit0ResultQuery (QString q, QString err, bool tdisabled=false)
 
QVariant submit1ResultQuery (QString q, QString err, bool tdisabled=false)
 
HPlainDataMatrixsubmitNResultQuery (int N, QString q, QString err, bool tdisabled=false)
 
void transaction (void)
 
QSqlDatabase workDB (void)
 
- Public Member Functions inherited from HSqlInterface
 HSqlInterface ()
 
 ~HSqlInterface ()
 
void cloneSqlInterfaceSettingsFrom (HSqlInterface *other)
 
HSqlSingleInterfacemyInterface (void)
 
QString sqlConcatenateToLocal (QString string)
 
QString sqlConcatenateToLocal (QStringList fields)
 
- Public Member Functions inherited from HBase
 HBase (void)
 
 ~HBase (void)
 
QString getWhoami (void)
 

Public Attributes

QString errorText
 
bool tdisabled
 

Additional Inherited Members

- Static Public Member Functions inherited from HSqlHandler
static void setCustomSqlDatabase (QString databaseName, QString sqlinterfacename="")
 
static void setDefaultSqlDatabase (void)
 
- Static Public Member Functions inherited from HSqlInterface
static HSqlSingleInterfacecurrentDefaultSqlInterface (void)
 
static HSqlSingleInterfacegetSqlInterface (QString interfacename)
 
static void setSqlMode (QString modename)
 
static void setSqlModeBackToFirst (void)
 
- Static Public Attributes inherited from HSqlHandler
static int trans = 0
 
- Protected Attributes inherited from HSqlHandler
bool query_error_occured
 
- Protected Attributes inherited from HBase
QString whoami
 

Detailed Description

This class can connect a HDynTable object to the sql database. It can read/update/insert the data according the emelent's sqlname attribute and the given parameters. (You can see an example in HDynTable describe)

See Also
HDynTable

Definition at line 4010 of file datalib.h.

Constructor & Destructor Documentation

HDynTableSqlConnector::HDynTableSqlConnector ( HDynTable dynt,
QString  tablename,
QString  filterpart = "" 
)
inline

It creates a connection to the database

Parameters
dyntThe HDynTable to connect.
tablenameThe name of the sql table contains the data
filterpartCan contains a SQL filter text which used on reading/updating. It can be empty, or "key='1' for exmaple."

Definition at line 4027 of file datalib.h.

Member Function Documentation

void HDynTableSqlConnector::insertSql ( QString  additionaldefpart = "",
QString  additionalvaluepart = "" 
)

Inserts the content of table to the database according the parameters given to the constructor

Parameters
additionaldefpartAdditional fields to insert, definitions (Example: "id,lastmod")
additionalvaluepartAdditional filelds to insert, values (Example: "\'001\',now()")

Definition at line 8318 of file datalib.cpp.

void HDynTableSqlConnector::justReaded ( void  )
signal

Emitted when the data just readed from the sql database

void HDynTableSqlConnector::justUpdated ( void  )
signal

Emitted when the data just updated to the sql database

int HDynTableSqlConnector::readSql ( void  )
slot

Reads the data from sql

Definition at line 8362 of file datalib.cpp.

QString HDynTableSqlConnector::sqlCreateString ( QString  switches = "")

Generates the sql create (DDL) string of the meta table. (CREATE TABLE ...)

Returns
The sql create command
Parameters
switchesstring can contain modifiers. Currently there is not implemented any modifier.

Definition at line 8434 of file datalib.cpp.

int HDynTableSqlConnector::updateSql ( void  )
slot

Updates the data to the sql

Definition at line 8404 of file datalib.cpp.

Member Data Documentation

QString HDynTableSqlConnector::errorText

This text is passed to the HSqlHandler when a new sql query started. Default is "Error in HDynTableSqlConnector"

Definition at line 4020 of file datalib.h.

bool HDynTableSqlConnector::tdisabled

If this attribute is true, the class doesn't start a new transaction when run an sql query Default is false.

Definition at line 4017 of file datalib.h.


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