DbStruct Pile   version 0.0.1
This pile contains classes that can be used to
DbRecord Class Referenceabstract

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).
 

Detailed Description

A record in a database.

Detailed description.

Constructor & Destructor Documentation

DbRecord::DbRecord ( )

Default constructor.

Detailed description for conrecordor.

DbRecord::~DbRecord ( )
virtual

Destructor.

Detailed description for derecordor.

Member Function Documentation

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.

Parameters
columnindex of the column to use for initialization
Returns
true if the inistance was initialized

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