My client is using Plex (v 6.1) with DDS.
I am helping them create an Operational Data Store in SQL Server. We're using IIDR CDC to replicate from DB2 for i to SQL Server 2016. When a table is added to the ODS, I want to automatically create the FKs (defined by Owned By and Refers to) and matching IXs in SQL Server.
I have figured out how to add the PKs by using DB2 system catalog metadata to find the matching real attributes view for any physical table being replicated and I create the PK from the real attribute view's corresponding unique key.
But since DDS was used, there are no declared FKs in the DB2 system catalog, so I need to harvest the info from the Plex Model via the API.
I've figured out how to get the refers to entities and find the corresponding foreign key view to get the foreign key fields no problem (I think).
Owned by is a special type of foreign key situation.
There are other things I want to harvest from Plex that I will store in a relational DB table for use in processes on the ODS.
I cannot build to DDL (it's not an option for many reasons), nor can I export the Model to XML (it's not an option for many reasons).
So now you have a little background.
The question remains, can you help me? I've got the recursion working and I'm able to get all known by fields and can traverse the non-inherited owned by entities. I'm not quite sure what to do when I come to an owned by that has no known by fields like where inheritence is involved.