Herunterladen als
root/src/tableschema.cpp @ 14f9beed
4d58ef6a | Christian Ehringfeld | #include "tableschema.h"
|
|
b0b8dac3 | Christian Ehringfeld | using namespace CuteEntityManager;
|
|
4d58ef6a | Christian Ehringfeld | ||
426974c6 | Christian Ehringfeld | TableSchema::TableSchema() {
|
|
4d58ef6a | Christian Ehringfeld | ||
}
|
|||
426974c6 | Christian Ehringfeld | TableSchema::~TableSchema() {
|
|
4d58ef6a | Christian Ehringfeld | ||
}
|
|||
14f9beed | Christian Ehringfeld | const QSharedPointer<QSqlField> TableSchema::getColumn(QString name) const {
|
|
auto columns = this->getColumns();
|
|||
foreach (auto schema, columns) {
|
|||
if (schema.data()->name() == name) {
|
|||
return schema;
|
|||
}
|
|||
}
|
|||
return QSharedPointer<QSqlField>();
|
|||
426974c6 | Christian Ehringfeld | }
|
|
14f9beed | Christian Ehringfeld | const QStringList TableSchema::getColumnNames() {
|
|
QStringList l;
|
|||
auto columns = this->getColumns();
|
|||
foreach (auto schema, columns) {
|
|||
l.append(schema.data()->name());
|
|||
}
|
|||
return l;
|
|||
426974c6 | Christian Ehringfeld | }
|
|
caea9141 | Christian Ehringfeld | ||
426974c6 | Christian Ehringfeld | QString TableSchema::getSchemaName() const {
|
|
return schemaName;
|
|||
}
|
|||
void TableSchema::setSchemaName(const QString &value) {
|
|||
schemaName = value;
|
|||
}
|
|||
QString TableSchema::getName() const {
|
|||
return name;
|
|||
}
|
|||
void TableSchema::setName(const QString &value) {
|
|||
name = value;
|
|||
}
|
|||
QString TableSchema::getFullName() const {
|
|||
return fullName;
|
|||
}
|
|||
void TableSchema::setFullName(const QString &value) {
|
|||
fullName = value;
|
|||
}
|
|||
14f9beed | Christian Ehringfeld | QStringList TableSchema::getPrimaryKeys() const {
|
|
426974c6 | Christian Ehringfeld | return primaryKeys;
|
|
}
|
|||
14f9beed | Christian Ehringfeld | void TableSchema::setPrimaryKeys(const QStringList &value) {
|
|
426974c6 | Christian Ehringfeld | primaryKeys = value;
|
|
}
|
|||
QString TableSchema::getSequenceName() const {
|
|||
return sequenceName;
|
|||
}
|
|||
void TableSchema::setSequenceName(const QString &value) {
|
|||
sequenceName = value;
|
|||
}
|
|||
14f9beed | Christian Ehringfeld | QHash<QString, QSharedPointer<QSqlField> > TableSchema::getColumns() const {
|
|
426974c6 | Christian Ehringfeld | return columns;
|
|
}
|
|||
14f9beed | Christian Ehringfeld | void TableSchema::setColumns(const QHash<QString, QSharedPointer<QSqlField> > &value) {
|
|
426974c6 | Christian Ehringfeld | columns = value;
|
|
}
|
|||
14f9beed | Christian Ehringfeld | QHash<QString, QSharedPointer<QSqlRelation> > TableSchema::getRelations() const {
|
|
return relations;
|
|||
}
|
|||
void TableSchema::setRelations(const QHash<QString, QSharedPointer<QSqlRelation> > &value) {
|
|||
relations = value;
|
|||
}
|