aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/common/table.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2015-04-04 14:41:04 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2015-04-04 14:41:04 -0400
commita5b034d4a9c44f9bc1e83b01de82530f8fc63013 (patch)
tree7a358206c4aff9c33df1752c92eafec97cee2244 /SQLiteStudio3/coreSQLiteStudio/common/table.cpp
parent306d6d3ca9c9ad774d19135681a7f9805f77035f (diff)
Imported Upstream version 3.0.4upstream/3.0.4
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/common/table.cpp')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/common/table.cpp40
1 files changed, 40 insertions, 0 deletions
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());
+}