From a5b034d4a9c44f9bc1e83b01de82530f8fc63013 Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Sat, 4 Apr 2015 14:41:04 -0400 Subject: Imported Upstream version 3.0.4 --- SQLiteStudio3/coreSQLiteStudio/common/table.cpp | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'SQLiteStudio3/coreSQLiteStudio/common/table.cpp') diff --git a/SQLiteStudio3/coreSQLiteStudio/common/table.cpp b/SQLiteStudio3/coreSQLiteStudio/common/table.cpp index c590995..a9b0f16 100644 --- a/SQLiteStudio3/coreSQLiteStudio/common/table.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/common/table.cpp @@ -50,3 +50,43 @@ int qHash(Table table) { return qHash(table.getDatabase() + "." + table.getTable()); } + +AliasedTable::AliasedTable() +{ +} + +AliasedTable::AliasedTable(const QString& database, const QString& table, const QString& alias) : + Table(database, table) +{ + setTableAlias(alias); +} + +AliasedTable::AliasedTable(const AliasedTable& other) : + Table(other.database, other.table) +{ + tableAlias = other.tableAlias; +} + +AliasedTable::~AliasedTable() +{ +} + +int AliasedTable::operator ==(const AliasedTable& other) const +{ + return other.database == this->database && other.table == this->table && other.tableAlias == this->tableAlias; +} + +QString AliasedTable::getTableAlias() const +{ + return tableAlias; +} + +void AliasedTable::setTableAlias(const QString& value) +{ + tableAlias = value; +} + +int qHash(AliasedTable table) +{ + return qHash(table.getDatabase() + "." + table.getTable() + " " + table.getTableAlias()); +} -- cgit v1.2.3