10 #ifndef GUARD_DBSTRUCT_H_INCLUDE
11 #define GUARD_DBSTRUCT_H_INCLUDE
13 #include <dbstruct/dbstruct-config.h>
18 #include <QSqlDatabase>
42 const QString & value) {
43 return taew (idFromName (value));
56 databaseName ()
const = 0;
66 const QString & value)
const = 0;
89 const QString & value)
const = 0;
102 int value)
const = 0;
107 int value)
const = 0;
112 const QString & value)
const = 0;
118 int index)
const = 0;
147 inline QSqlDatabase &
165 #define META_DATA_BASE_CTORS(__name__) \
166 __name__() : __name__ ## Meta(), DbStruct() {} \
167 __name__(const QSqlDatabase & db) : __name__ ## Meta(), DbStruct(db) {}
170 #define META_DATA_BASE_GETTER \
171 virtual DbStructMeta * \
173 return static_cast<DbStructMeta*>(this); \
177 #define META_DATA_BASE(__name__) \
178 class %(EXPORT)s __name__ : public __name__ ## Meta, public DbStruct { \
180 META_DATA_BASE_CTORS(__name__); \
181 META_DATA_BASE_GETTER; \
185 #endif // GUARD_DBSTRUCT_H_INCLUDE
Definition: dbobject.h:36
DbStruct()
Default constructor.
Definition: dbstruct.h:137
Declarations for DbView class.
Declarations for DbTable class.
void setDatabase(const QSqlDatabase &value)
Set the database.
Definition: dbstruct.h:154
Declarations for DbObject class.
Type
The types of objects that use this class as a base.
Definition: dbobject.h:33
A table or view in a database.
Definition: dbtaew.h:24
QSqlDatabase & database()
Retreive the database.
Definition: dbstruct.h:148
The objecture of a database.
Definition: dbobject.h:28
The structure of a database.
Definition: dbstruct.h:130
DbStruct(const QSqlDatabase &db)
Constructor that also initializes the database.
Definition: dbstruct.h:142