Herunterladen als
root/src/tableschema.h @ 19cf5548
c22391b2 | Christian Ehringfeld | /*
|
|
* Copyright (C) 2015 Christian Ehringfeld <c.ehringfeld@t-online.de>
|
|||
*
|
|||
* This program is free software; you can redistribute it and/or modify it
|
|||
* under the terms of the GNU Lesser General Public License as published by
|
|||
* the Free Software Foundation.
|
|||
*
|
|||
* This program is distributed in the hope that it will be useful, but
|
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|||
* for more details.
|
|||
*
|
|||
* You should have received a copy of the GNU Lesser General Public License
|
|||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
|||
4d58ef6a | Christian Ehringfeld | #ifndef TABLESCHEMA_H
|
|
#define TABLESCHEMA_H
|
|||
426974c6 | Christian Ehringfeld | #include <QString>
|
|
#include <QList>
|
|||
14f9beed | Christian Ehringfeld | #include <QStringList>
|
|
426974c6 | Christian Ehringfeld | #include <QHash>
|
|
14f9beed | Christian Ehringfeld | #include <QSharedPointer>
|
|
#include <QSqlField>
|
|||
#include <QSqlRelation>
|
|||
b0e92bc6 | Christian Ehringfeld | #include <QSqlRelationalTableModel>
|
|
4d58ef6a | Christian Ehringfeld | namespace CuteEntityManager {
|
|
class TableSchema {
|
|||
426974c6 | Christian Ehringfeld | public:
|
|
4d58ef6a | Christian Ehringfeld | TableSchema();
|
|
8306a974 | Christian Ehringfeld | virtual ~TableSchema();
|
|
14f9beed | Christian Ehringfeld | virtual QSharedPointer<QSqlField> const getColumn(QString name) const;
|
|
virtual const QStringList getColumnNames();
|
|||
2c152ba3 | Christian Ehringfeld | ||
426974c6 | Christian Ehringfeld | QString getSchemaName() const;
|
|
void setSchemaName(const QString &value);
|
|||
QString getName() const;
|
|||
void setName(const QString &value);
|
|||
QString getFullName() const;
|
|||
void setFullName(const QString &value);
|
|||
14f9beed | Christian Ehringfeld | QStringList getPrimaryKeys() const;
|
|
void setPrimaryKeys(const QStringList &value);
|
|||
426974c6 | Christian Ehringfeld | ||
QString getSequenceName() const;
|
|||
void setSequenceName(const QString &value);
|
|||
14f9beed | Christian Ehringfeld | QHash<QString, QSharedPointer<QSqlField> > getColumns() const;
|
|
void setColumns(const QHash<QString, QSharedPointer<QSqlField> > &value);
|
|||
426974c6 | Christian Ehringfeld | ||
14f9beed | Christian Ehringfeld | QHash<QString, QSharedPointer<QSqlRelation> > getRelations() const;
|
|
void setRelations(const QHash<QString, QSharedPointer<QSqlRelation> > &value);
|
|||
426974c6 | Christian Ehringfeld | ||
b0e92bc6 | Christian Ehringfeld | QSharedPointer<QSqlRelationalTableModel> getTableModel() const;
|
|
e0e1ead8 | Christian Ehringfeld | private:
|
|
426974c6 | Christian Ehringfeld | QString schemaName;
|
|
QString name;
|
|||
QString fullName;
|
|||
14f9beed | Christian Ehringfeld | QStringList primaryKeys;
|
|
426974c6 | Christian Ehringfeld | QString sequenceName;
|
|
14f9beed | Christian Ehringfeld | QHash<QString, QSharedPointer<QSqlRelation>> relations;
|
|
QHash<QString, QSharedPointer<QSqlField>> columns;
|
|||
b0e92bc6 | Christian Ehringfeld | ||
4d58ef6a | Christian Ehringfeld | };
|
|
}
|
|||
#endif // TABLESCHEMA_H
|