Hi, I had the following situation which worked fine: MyBase class inherited by MyClassA and by MyClassB. MyBase had the HierarchyRoot attribute specified without parameters thus the default ClassTable inheritance scheme. Then in MyClassB I added two indexes on two string fields:
and it could not build anymore because of the following exception: "Unable to build index IMyBase.FK_MyClassX.UNION.IMyBase.UNION.IMyClassB because it contains inherited fields." Changing the HierarchyRoot inheritance scheme from ClassTable to ConcreteTable seemed to work out ok but I still feel things should work also with the ClassTable scheme. So my question is: are we dealing with a bug here or are there e.g. conceptual reasons why I should choose the ConcreteTable in this case? |
Hi Dmitri, Thank you for your explanation. So the final answer comes down to this: When using the ClassTable scheme where class X inherits from class Y and class X implements an interface with fields implemented by class Y and not by class X then DO.Net is not able to resolve this because it is not possible (for DO.Net) to bring things back together again because of the 'physical' implementation in the database. I can live with this and work-around it and avoid problems but it also seems a bit strange to me since everything you require is available. Both data and information about how data is related and indexes can be created on the column in the table that actually contains it. So is this something that might be fixed in the future or is it way too complex within the DO architecture to resolve this? Hello Jos, There are some limitations in the architecture of current version of |
Hello Jos, Thanks for clarification, I needed it to answer properly. The exceptions tells us that there is the following situation (simplified):
As Hope that helps. |
Could you please specify in what class Field1 and Field2 are declared?
I mentioned this is in MyClassB.
Jos, are there any interfaces used in these classes?
Sorry I missed your question, yes there are interfaces.
Maybe it is also related to this issue