Eneboo - Documentación para desarrolladores
|
The QSqlRecord class encapsulates a database record, i.e. a set of database fields. Más...
#include <qsqlrecord.h>
Métodos públicos | |
QSqlRecord () | |
QSqlRecord (const QSqlRecord &other) | |
QSqlRecord & | operator= (const QSqlRecord &other) |
virtual | ~QSqlRecord () |
virtual QVariant | value (int i) const |
virtual QVariant | value (const QString &name) const |
virtual void | setValue (int i, const QVariant &val) |
virtual void | setValue (const QString &name, const QVariant &val) |
bool | isGenerated (int i) const |
bool | isGenerated (const QString &name) const |
virtual void | setGenerated (const QString &name, bool generated) |
virtual void | setGenerated (int i, bool generated) |
virtual void | setNull (int i) |
virtual void | setNull (const QString &name) |
bool | isNull (int i) |
bool | isNull (const QString &name) |
bool | isNull (int i) const |
bool | isNull (const QString &name) const |
int | position (const QString &name) const |
QString | fieldName (int i) const |
QSqlField * | field (int i) |
QSqlField * | field (const QString &name) |
const QSqlField * | field (int i) const |
const QSqlField * | field (const QString &name) const |
virtual void | append (const QSqlField &field) |
virtual void | insert (int pos, const QSqlField &field) |
virtual void | remove (int pos) |
bool | isEmpty () const |
bool | contains (const QString &name) const |
virtual void | clear () |
virtual void | clearValues (bool nullify=FALSE) |
uint | count () const |
virtual QString | toString (const QString &prefix=QString::null, const QString &sep=",") const |
virtual QStringList | toStringList (const QString &prefix=QString::null) const |
QSqlRecord () | |
QSqlRecord (const QSqlRecord &other) | |
QSqlRecord & | operator= (const QSqlRecord &other) |
virtual | ~QSqlRecord () |
virtual QVariant | value (int i) const |
virtual QVariant | value (const QString &name) const |
virtual void | setValue (int i, const QVariant &val) |
virtual void | setValue (const QString &name, const QVariant &val) |
bool | isGenerated (int i) const |
bool | isGenerated (const QString &name) const |
virtual void | setGenerated (const QString &name, bool generated) |
virtual void | setGenerated (int i, bool generated) |
virtual void | setNull (int i) |
virtual void | setNull (const QString &name) |
bool | isNull (int i) |
bool | isNull (const QString &name) |
bool | isNull (int i) const |
bool | isNull (const QString &name) const |
int | position (const QString &name) const |
QString | fieldName (int i) const |
QSqlField * | field (int i) |
QSqlField * | field (const QString &name) |
const QSqlField * | field (int i) const |
const QSqlField * | field (const QString &name) const |
virtual void | append (const QSqlField &field) |
virtual void | insert (int pos, const QSqlField &field) |
virtual void | remove (int pos) |
bool | isEmpty () const |
bool | contains (const QString &name) const |
virtual void | clear () |
virtual void | clearValues (bool nullify=FALSE) |
uint | count () const |
virtual QString | toString (const QString &prefix=QString::null, const QString &sep=",") const |
virtual QStringList | toStringList (const QString &prefix=QString::null) const |
The QSqlRecord class encapsulates a database record, i.e. a set of database fields.
sql
The QSqlRecord class encapsulates the functionality and characteristics of a database record (usually a table or view within the database). QSqlRecords support adding and removing fields as well as setting and retrieving field values.
QSqlRecord is implicitly shared. This means you can make copies of the record in time O(1). If multiple QSqlRecord instances share the same data and one is modifying the record's data then this modifying instance makes a copy and modifies its private copy - thus it does not affect other instances.
QSqlRecord::QSqlRecord | ( | ) |
Constructs an empty record.
QSqlRecord::QSqlRecord | ( | const QSqlRecord & | other | ) |
Constructs a copy of other.
QSqlRecord::~QSqlRecord | ( | ) | [virtual] |
Destroys the object and frees any allocated resources.
QSqlRecord::QSqlRecord | ( | ) |
QSqlRecord::QSqlRecord | ( | const QSqlRecord & | other | ) |
virtual QSqlRecord::~QSqlRecord | ( | ) | [virtual] |
void QSqlRecord::append | ( | const QSqlField & | field | ) | [virtual] |
virtual void QSqlRecord::append | ( | const QSqlField & | field | ) | [virtual] |
void QSqlRecord::clear | ( | void | ) | [virtual] |
Removes all the record's fields.
Reimplementado en QSqlCursor, QSqlSelectCursor, QSqlCursor y QSqlSelectCursor.
virtual void QSqlRecord::clear | ( | ) | [virtual] |
Reimplementado en QSqlCursor, QSqlSelectCursor, QSqlCursor y QSqlSelectCursor.
void QSqlRecord::clearValues | ( | bool | nullify = FALSE | ) | [virtual] |
Clears the value of all fields in the record. If nullify is TRUE, (the default is FALSE), each field is set to NULL.
virtual void QSqlRecord::clearValues | ( | bool | nullify = FALSE | ) | [virtual] |
Returns TRUE if there is a field in the record called name; otherwise returns FALSE.
uint QSqlRecord::count | ( | ) | const |
Returns the number of fields in the record.
uint QSqlRecord::count | ( | ) | const |
Returns the field at position i within the record, or 0 if it cannot be found.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Returns the field called name within the record, or 0 if it cannot be found. Field names are not case-sensitive.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Returns the field called name within the record, or 0 if it cannot be found. Field names are not case-sensitive.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.
Returns the name of the field at position i. If the field does not exist, QString::null is returned.
Insert a copy of field at position pos. If a field already exists at pos, it is removed.
bool QSqlRecord::isEmpty | ( | void | ) | const |
Returns TRUE if there are no fields in the record; otherwise returns FALSE.
bool QSqlRecord::isEmpty | ( | ) | const |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Returns TRUE if the record has a field at position i and this field is to be generated (the default); otherwise returns FALSE.
Returns TRUE if the record has a field called name and this field is to be generated (the default); otherwise returns FALSE.
Reimplementado en QSqlCursor y QSqlCursor.
Reimplementado en QSqlCursor y QSqlCursor.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Returns TRUE if the field i is NULL or if there is no field at position i; otherwise returns FALSE.
Reimplementado en QSqlCursor y QSqlCursor.
Returns TRUE if the field called name is NULL or if there is no field called name; otherwise returns FALSE.
Reimplementado en QSqlCursor y QSqlCursor.
QSqlRecord& QSqlRecord::operator= | ( | const QSqlRecord & | other | ) |
QSqlRecord & QSqlRecord::operator= | ( | const QSqlRecord & | other | ) |
Sets the record equal to other.
Returns the position of the field called name within the record, or -1 if it cannot be found. Field names are not case-sensitive. If more than one field matches, the first one is returned.
void QSqlRecord::remove | ( | int | pos | ) | [virtual] |
Removes the field at pos. If pos does not exist, nothing happens.
Reimplementado en QSqlCursor, QSqlSelectCursor, QSqlCursor y QSqlSelectCursor.
virtual void QSqlRecord::remove | ( | int | pos | ) | [virtual] |
Reimplementado en QSqlCursor, QSqlSelectCursor, QSqlCursor y QSqlSelectCursor.
Sets the generated flag for the field called name to generated. If the field does not exist, nothing happens. Only fields that have generated set to TRUE are included in the SQL that is generated, e.g. by QSqlCursor.
Reimplementado en QSqlCursor, QSqlSelectCursor, QSqlCursor y QSqlSelectCursor.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the generated flag for the field i to generated.
Reimplementado en QSqlCursor, QSqlSelectCursor, QSqlCursor y QSqlSelectCursor.
Reimplementado en QSqlCursor, QSqlSelectCursor, QSqlCursor y QSqlSelectCursor.
Reimplementado en QSqlCursor, QSqlSelectCursor, QSqlCursor y QSqlSelectCursor.
void QSqlRecord::setNull | ( | int | i | ) | [virtual] |
Sets the value of field i to NULL. If the field does not exist, nothing happens.
virtual void QSqlRecord::setNull | ( | const QString & | name | ) | [virtual] |
virtual void QSqlRecord::setNull | ( | int | i | ) | [virtual] |
void QSqlRecord::setNull | ( | const QString & | name | ) | [virtual] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the value of the field called name to NULL. If the field does not exist, nothing happens.
Reimplementado en QSqlCursor y QSqlCursor.
Sets the value of the field at position i to val. If the field does not exist, nothing happens.
Reimplementado en QSqlCursor y QSqlCursor.
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the value of the field called name to val. If the field does not exist, nothing happens.
Reimplementado en QSqlCursor y QSqlCursor.
Reimplementado en QSqlCursor y QSqlCursor.
virtual QString QSqlRecord::toString | ( | const QString & | prefix = QString::null , |
const QString & | sep = "," |
||
) | const [virtual] |
Reimplementado en QSqlCursor, QSqlSelectCursor, QSqlCursor y QSqlSelectCursor.
QString QSqlRecord::toString | ( | const QString & | prefix = QString::null , |
const QString & | sep = "," |
||
) | const [virtual] |
Returns a list of all the record's field names as a string separated by sep.
Note that fields which are not generated are not included (see {isGenerated()}). The returned string is suitable, for example, for generating SQL SELECT statements. If a prefix is specified, e.g. a table name, all fields are prefixed in the form:
"\a{prefix}.\<fieldname\>"
Reimplementado en QSqlCursor, QSqlSelectCursor, QSqlCursor y QSqlSelectCursor.
QStringList QSqlRecord::toStringList | ( | const QString & | prefix = QString::null | ) | const [virtual] |
Returns a list of all the record's field names, each having the prefix prefix.
Note that fields which have generated set to FALSE are not included. (See {isGenerated()}). If prefix is supplied, e.g. a table name, all fields are prefixed in the form:
"\a{prefix}.\<fieldname\>"
virtual QStringList QSqlRecord::toStringList | ( | const QString & | prefix = QString::null | ) | const [virtual] |
Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Returns the value of the field called name in the record. If field name does not exist the resultant behaviour is undefined.
Reimplementado en QSqlCursor y QSqlCursor.
Returns the value of the field located at position i in the record. If field i does not exist the resultant behaviour is undefined.
This function should be used with {QSqlQuery}s. When working with a QSqlCursor the value(const QString&) overload which uses field names is more appropriate.
Reimplementado en QSqlCursor y QSqlCursor.
Reimplementado en QSqlCursor y QSqlCursor.
Reimplementado en QSqlCursor y QSqlCursor.