DbStruct Pile   version 0.0.1
This pile contains classes that can be used to
dbtaew.h
Go to the documentation of this file.
1 
10 #ifndef GUARD_DBTAEW_H_INCLUDE
11 #define GUARD_DBTAEW_H_INCLUDE
12 
13 #include <dbstruct/dbstruct-config.h>
14 #include <dbstruct/dbobject.h>
15 #include <dbstruct/dbobject.h>
16 
17 QT_BEGIN_NAMESPACE
18 class QObject;
19 class QSqlTableModel;
20 class QSqlDatabase;
21 QT_END_NAMESPACE
22 
24 class DBSTRUCT_EXPORT DbTaew : public DbObject {
25 
26 public:
27 
29  enum Codes {
30  ID_NEW_INSTANCE = -1,
31  ID_UNAVAILABLE = -2
32  };
33 
35  DbTaew ();
36 
38  virtual ~DbTaew();
39 
41  bool
42  hasColumn(
43  const QString & s_name) const;
44 
46  int
47  columnIndex (
48  const QString & s_name) const;
49 
51  int
52  realColumnIndex (
53  const QString & s_name) const;
54 
56  virtual QSqlTableModel *
57  sqlModel (
58  QSqlDatabase & database,
59  QObject * parent = NULL) const;
60 
61 
62  /* - - - - - - - - - - - - - - - - */
66 
68 
70  virtual QString
71  tableName() const = 0;
72 
74  virtual QString
75  modifyTableName() const {
76  return tableName();
77  }
78 
80  virtual QString
81  columnName(
82  int i) const = 0;
83 
85  virtual QString
86  columnLabel (
87  int i) const = 0;
88 
90  virtual int
91  columnCount() const = 0;
92 
94  virtual QStringList
95  columns() const = 0;
96 
98  virtual int
99  idColumn () const = 0;
100 
102  virtual QString
103  commaColumns () const = 0;
104 
106  virtual QString
107  commaColumnsNoId () const = 0;
108 
110  virtual QString
111  columnColumns () const = 0;
112 
114  virtual QString
115  assignColumns () const = 0;
116 
118  virtual DbColumn
119  columnCtor (
120  int i) const = 0;
121 
123  virtual DbRecord *
124  createDefaultRecord () const = 0;
125 
127  virtual int
128  toRealIndex (int) const = 0;
129 
131  virtual int
132  fromRealIndex (int) const = 0;
133 
135  /* - - - - - - - - - - - - - - - - */
136 
137 protected:
138 
139 private:
140 };
141 
142 #endif // GUARD_DBTAEW_H_INCLUDE
A record in a database.
Definition: dbrecord.h:34
Codes
Special codes.
Definition: dbtaew.h:29
Declarations for DbObject class.
The columnure of a database.
Definition: dbcolumn.h:27
virtual QString modifyTableName() const
Where updates should go.
Definition: dbtaew.h:75
A table or view in a database.
Definition: dbtaew.h:24
The objecture of a database.
Definition: dbobject.h:28