HiI'm going to add support for horizontal inheritance to cayenne. I've already added functionality for an entity to be abstract (https://issues.apache.org/cayenne/browse/CAY-794 ), now the second part.
Current implementation of inheritance allows only one of two parameters set: "inheritance" or "table/view" If inheritance is selected the ObjEntity does not have any own DbEntity or DbAttributes, it gets them only from the parent ObjEntity. (although it has all the ObjAttributes defined in model) Table/view is a simple approach where the ObjEntity gets its attributes from its definition in model, there is no parent ObjEntity.
For horizontal inheritance ObjEnity.getAttributes() should return both the attributes defined in model as well as from parent ObjEntity. Yet having both parameters accepted at the same time might now do it well enough, therefore I would like to propose adding yet another parameter to the model: "inheritance db relationship". On database level the horizontal inheritance is nothing more than a one-to-one relationship between two tables, and reflecting this in the model will be required to route the queries and inserts correctly.
Did I miss something ? Is that the right approach ? Marcin
smime.p7s
Description: S/MIME cryptographic signature
