27 #include "../../../dataaccess/dataset/DataSetType.h"
28 #include "../../../dataaccess/dataset/PrimaryKey.h"
29 #include "../utils/DoubleListWidget.h"
31 #include "ui_ConstraintWidgetForm.h"
32 #include "ui_DoubleListWidgetForm.h"
50 if(m_ui->m_nameLineEdit->text().isEmpty())
55 std::string constraintName = m_ui->m_nameLineEdit->text().toStdString();
58 std::vector<std::string> vec = m_doubleListWidget->getOutputValues();
70 for(
size_t t = 0; t < vec.size(); ++t)
90 m_ui->m_nameLineEdit->setText(pk->
getName().c_str());
93 std::vector<std::string> pkPropsStr;
94 for(std::size_t i = 0; i < pkProps.size(); ++i)
96 pkPropsStr.push_back(pkProps[i]->getName());
99 std::vector<te::dt::Property*> dtProps = m_dsType->getProperties();
100 std::vector<std::string> dtPropsStr;
101 for(std::size_t i = 0; i < dtProps.size(); ++i)
103 std::string propStr = dtProps[i]->getName();
105 if(std::find(pkPropsStr.begin(), pkPropsStr.end(), propStr) != pkPropsStr.end())
108 dtPropsStr.push_back(propStr);
111 m_doubleListWidget->setInputValues(dtPropsStr);
112 m_doubleListWidget->setOutputValues(pkPropsStr);
virtual void setName(const std::string &name)
It sets the constraint name.
void add(te::dt::Property *p)
It adds a property to the list of properties of the primary key.
A class that models the description of a dataset.
virtual Property * clone() const =0
It returns a clone of the object.
It models a property definition.
const std::vector< te::dt::Property * > & getProperties() const
It returns the properties that take part of the primary key.
It describes a primary key (pk) constraint.
virtual const std::string & getName() const
It returns the constraint name.