How to relate an object which derives from another object in a database?

3
Hi, I want to use the data in the database for another reporting tool. The model contains an relation and a customer. Customer derives from Relation. In the database I can see the 2 entities in 2 separated tables. I want to use attributes from the customer table as well from the relation table for reporting. How can I define the key between customer and relation? Thanks!
asked
1 answers
5

Both tables have the column 'id', which is the key of each table. Each row in the customer table has a corresponding row in the relation table and the id's of both rows are equal.

In the relation table, there is also a column with the name 'submetaobjectname'. This column contains the name of the type when the row belongs to a specific subtype. When you have a customer, the corresponding row in the relation table contains the value 'Module.Customer' in the column 'submetaobjectname'.

When an object does not have subtypes, the corresponding table for this object does not contain the column 'submetaobjectname', because it does not say anything in that case.

answered