Commit a56b6b13 by maarten

prepper met HEM/HEC

git-svn-id: svn+ssh://gitlab/srv/svn-repos/pdb-redo/trunk@517 a1961a4f-ab94-4bcc-80e8-33b5a54de466
parent b6e8f79c
...@@ -950,6 +950,14 @@ struct Key ...@@ -950,6 +950,14 @@ struct Key
string value(v ? v : ""); string value(v ? v : "");
return Condition(new detail::KeyIsConditionImpl<std::string>(mItemTag, value)); return Condition(new detail::KeyIsConditionImpl<std::string>(mItemTag, value));
} }
Condition operator==(const detail::ItemReference& v) const
{
if (v.empty())
return Condition(new detail::KeyIsEmptyConditionImpl(mItemTag));
else
return Condition(new detail::KeyIsConditionImpl<std::string>(mItemTag, v.c_str()));
}
Condition operator==(const Empty&) const Condition operator==(const Empty&) const
{ {
......
...@@ -2432,19 +2432,27 @@ void Row::assign(size_t column, const string& value, bool skipUpdateLinked) ...@@ -2432,19 +2432,27 @@ void Row::assign(size_t column, const string& value, bool skipUpdateLinked)
string pk = linked->mParentKeys[ix]; string pk = linked->mParentKeys[ix];
string ck = linked->mChildKeys[ix]; string ck = linked->mChildKeys[ix];
// TODO add code to *NOT* test mandatory fiels for Empty
if (pk == iv->mTag) if (pk == iv->mTag)
{ {
childTag = ck; childTag = ck;
cond = move(cond) && (Key(ck) == oldStrValue); cond = move(cond) && ((Key(ck) == oldStrValue) or Key(ck) == Empty());
} }
else else
{ {
const char* value = (*this)[pk].c_str(); const char* value = (*this)[pk].c_str();
cond = move(cond) && (Key(ck) == value); cond = move(cond) && ((Key(ck) == value) or Key(ck) == Empty());
} }
} }
// if (cif::VERBOSE > 2)
// {
// std::cerr << "Parent: " << linked->mParentCategory << " Child: " << linked->mChildCategory << std::endl
// << cond << std::endl;
// }
auto rows = childCat->find(move(cond)); auto rows = childCat->find(move(cond));
for (auto& cr: rows) for (auto& cr: rows)
cr.assign(childTag, value, false); cr.assign(childTag, value, false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment