DbStruct Pile
version 0.0.1
This pile contains classes that can be used to
|
A record in a database. More...
#include <dbrecord.h>
Public Member Functions | |
DbRecord () | |
Default constructor. More... | |
virtual | ~DbRecord () |
Destructor. More... | |
virtual DbObject::Type | type () const |
The type of this object. | |
bool | initFromId (DbTaew *table, QSqlDatabase &db, long db_id) |
Initialize this instance from a given id. | |
bool | initFrom (DbTaew *table, QSqlDatabase &db, int column) |
Initialize this instance from a given field. More... | |
virtual bool | save (DbTaew *table, QSqlDatabase &db) |
Saves the instance to the database. | |
bool | remFromDb (DbTaew *table, QSqlDatabase &db, int column) |
Remove this entry from the database. | |
virtual bool | isNew () const |
Tell if this instance is a new one or it has a database correspondent. | |
virtual void | bindOne (QSqlQuery &query, int i) const =0 |
Bind a single value identified by column index in a query. | |
virtual void | bind (QSqlQuery &query) const =0 |
Bind values to names in a query. | |
virtual DbRecMap | toMap () const =0 |
Export the content of a record to a map. | |
virtual bool | retreive (const QSqlQuery &query)=0 |
Get values from a query. | |
virtual bool | retreive (const QSqlRecord &rec)=0 |
Get values from a record. | |
virtual bool | retreive (const DbRecMap &map)=0 |
Load values from an associative array. | |
virtual void | setId (long) |
Set the index to given value (if the model has an id column). | |
virtual long | getId () const |
Get the index of this instance (if the model has an id column). | |
A record in a database.
Detailed description.
DbRecord::DbRecord | ( | ) |
Default constructor.
Detailed description for conrecordor.
|
virtual |
Destructor.
Detailed description for derecordor.
bool DbRecord::initFrom | ( | DbTaew * | table, |
QSqlDatabase & | db, | ||
int | column | ||
) |
Initialize this instance from a given field.
The value that coresponds to the column inside this instance should have been initialized by the caller with the value to search for.
column | index of the column to use for initialization |