Herunterladen als
root/src/join.cpp @ 38838b5b
38838b5b | 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/>.
|
|||
*/
|
|||
5d93390e | Christian Ehringfeld | #include "join.h"
|
|
using namespace CuteEntityManager;
|
|||
Join::Join() {
|
|||
}
|
|||
Join::Join(QString foreignTable, QString condition, QString type) {
|
|||
3160499c | Christian Ehringfeld | this->foreignTable = foreignTable;
|
|
this->condition = Condition(condition);
|
|||
this->type = type;
|
|||
}
|
|||
Join::Join(QString foreignTable, Condition condition, QString type) {
|
|||
5d93390e | Christian Ehringfeld | this->foreignTable = foreignTable;
|
|
this->condition = condition;
|
|||
this->type = type;
|
|||
}
|
|||
QString Join::getType() const {
|
|||
return type;
|
|||
}
|
|||
void Join::setType(const QString &value) {
|
|||
type = value;
|
|||
}
|
|||
QString Join::getForeignTable() const {
|
|||
return foreignTable;
|
|||
}
|
|||
void Join::setForeignTable(const QString &value) {
|
|||
foreignTable = value;
|
|||
}
|
|||
3160499c | Christian Ehringfeld | Condition Join::getCondition() const {
|
|
5d93390e | Christian Ehringfeld | return condition;
|
|
}
|
|||
3160499c | Christian Ehringfeld | QString Join::getMainCondition() const {
|
|
auto conditions = this->condition.getConditions();
|
|||
if (!conditions.isEmpty()) {
|
|||
return conditions.at(0);
|
|||
} else {
|
|||
return "";
|
|||
}
|
|||
5d93390e | Christian Ehringfeld | }
|
|
3160499c | Christian Ehringfeld | void Join::setCondition(const Condition &value) {
|
|
condition = value;
|
|||
}
|