#include <tsqlobject.h>
The TSqlObject class is the base class of ORM objects.
- See also
- TSqlORMapper
◆ TSqlObject() [1/2]
TSqlObject::TSqlObject |
( |
| ) |
|
◆ TSqlObject() [2/2]
TSqlObject::TSqlObject |
( |
const TSqlObject & |
other | ) |
|
◆ ~TSqlObject()
virtual TSqlObject::~TSqlObject |
( |
| ) |
|
|
inlinevirtual |
◆ autoValueIndex()
int TSqlObject::autoValueIndex |
( |
| ) |
const |
|
inlinevirtual |
Returns the position of the auto-generated value field on the table.
This is a virtual function.
◆ clear()
void TSqlObject::clear |
( |
| ) |
|
|
inlineoverridevirtual |
Clears the contents of the object.
Reimplemented from TModelObject.
◆ create()
bool TSqlObject::create |
( |
| ) |
|
|
overridevirtual |
Inserts new record into the database, based on the current properties of the object.
Implements TModelObject.
◆ databaseId()
int TSqlObject::databaseId |
( |
| ) |
const |
|
inlinevirtual |
◆ error()
QSqlError TSqlObject::error |
( |
| ) |
const |
|
inline |
Returns a QSqlError object which contains information about the last error that occurred on the database.
◆ getDatabase()
QSqlDatabase & TSqlObject::getDatabase |
( |
| ) |
|
|
protected |
◆ isModified()
bool TSqlObject::isModified |
( |
| ) |
const |
Returns true if the values of the properties differ with the record on the database; otherwise returns false.
◆ isNew()
bool TSqlObject::isNew |
( |
| ) |
const |
|
inline |
Returns true if it is a new object, otherwise returns false.
Equivalent to isNull().
◆ isNull()
bool TSqlObject::isNull |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns true if there is no database record associated with the object; otherwise returns false.
Implements TModelObject.
◆ operator=()
◆ primaryKeyIndex()
int TSqlObject::primaryKeyIndex |
( |
| ) |
const |
|
inlinevirtual |
Returns the position of the primary key field on the table.
This is a virtual function.
◆ reload()
bool TSqlObject::reload |
( |
| ) |
|
Reloads the values of the record onto the properties.
◆ remove()
bool TSqlObject::remove |
( |
| ) |
|
|
overridevirtual |
Deletes the record with this primary key from the database.
Implements TModelObject.
◆ save()
bool TSqlObject::save |
( |
| ) |
|
|
overridevirtual |
Depending on whether condition matches, inserts new record or updates the corresponding record with the properties of the object.
If possible, invokes UPSERT in relational database.
Implements TModelObject.
◆ setRecord()
void TSqlObject::setRecord |
( |
const QSqlRecord & |
record, |
|
|
const QSqlError & |
error |
|
) |
| |
Sets the record.
This function is for internal use only.
◆ syncToObject()
void TSqlObject::syncToObject |
( |
| ) |
|
|
protected |
Synchronizes the internal record data to the properties of the object.
This function is for internal use only.
◆ syncToSqlRecord()
void TSqlObject::syncToSqlRecord |
( |
| ) |
|
|
protected |
Synchronizes the properties to the internal record data.
This function is for internal use only.
◆ tableName()
QString TSqlObject::tableName |
( |
| ) |
const |
|
virtual |
Returns the table name, which is generated from the class name.
◆ update()
bool TSqlObject::update |
( |
| ) |
|
|
overridevirtual |
Updates the corresponding record with the properties of the object.
Implements TModelObject.
◆ sqlError
QSqlError TSqlObject::sqlError |
|
protected |
The documentation for this class was generated from the following files: