8 #include <QSqlDatabase>
10 #include <TModelObject>
21 virtual QString tableName()
const;
25 void setRecord(
const QSqlRecord &record,
const QSqlError &error);
31 bool isNull()
const override {
return QSqlRecord::isEmpty(); }
32 bool isNew()
const {
return QSqlRecord::isEmpty(); }
33 bool isModified()
const;
34 void clear()
override { QSqlRecord::clear(); }
35 QSqlError
error()
const {
return sqlError; }
38 void syncToSqlRecord();
40 QSqlDatabase &getDatabase();
45 QSqlDatabase _database;
The TModelObject class provides an abstract base for model objects.
Definition: tmodelobject.h:9
The TSqlObject class is the base class of ORM objects.
Definition: tsqlobject.h:13
virtual int autoValueIndex() const
Returns the position of the auto-generated value field on the table.
Definition: tsqlobject.h:23
bool isNull() const override
Returns true if there is no database record associated with the object; otherwise returns false.
Definition: tsqlobject.h:31
virtual int databaseId() const
Returns the database ID.
Definition: tsqlobject.h:24
QSqlError sqlError
Definition: tsqlobject.h:42
bool isNew() const
Returns true if it is a new object, otherwise returns false.
Definition: tsqlobject.h:32
void clear() override
Clears the contents of the object.
Definition: tsqlobject.h:34
QSqlError error() const
Returns a QSqlError object which contains information about the last error that occurred on the datab...
Definition: tsqlobject.h:35
virtual int primaryKeyIndex() const
Returns the position of the primary key field on the table.
Definition: tsqlobject.h:22
virtual ~TSqlObject()
Definition: tsqlobject.h:19
#define T_CORE_EXPORT
Definition: tdeclexport.h:28