Maintain a table with the inheritance relations of domains

<?xml version="1.0" encoding="UTF-8"?>
<DataDefn name="_Inheritance" key="inheritanceId">
  <DBEntry name="inheritanceId" type="Integer"> </DBEntry>
  <DBEntry name="parentDomain"> </DBEntry>
  <DBEntry name="childDomain"> </DBEntry>
</DataDefn>

This table is read at start-up. Both the in memory and database table are kept
up-to-date as domains are added/removed.

addRecordToDomain:
unchanged.
(requires up traversal of inheritance relation)

getRecordsInDomain:
for each domain derived from the target domain:
  1. query with the derived domain
  2. collect results

return contatenation of all results

deleteRecordsInDomain:
for each domain derived from the target domain:
  1. query with given filter
  2. collect affected rows as result

hold list of affected rows, by derived domain

for each domain derived from the target domain:
  1. delete with given filter

for each domain derived from the target domain:
  1. check for updates (direct and foreign)
  2. send updates (requires up traversal of inheritance relation)

setRecordsInDomain:
for each domain derived from the target domain:
  1. query with given filter
  2. collect affected rows as result

hold list of affected rows, by derived domain

for each domain derived from the target domain:
  1. set with given filter

for each domain derived from the target domain:
  1. check for updates (direct)
  2. send updates (requires up traversal of inheritance relation)


New primitive:
set<string> getDerivedDomains(const string& domain);
