Apache Cayenne > Index > Cayenne FAQ > Is Inheritance Supported
Added by Mike Kienenberger, last edited by Mike Kienenberger on Jun 17, 2005  (view change)

Cayenne supports single-table inheritance (flat, table-per-class-hierarchy) natively.

Vertical inheritance (table-per-subclass) is being discussed and worked on. As a workaround, it's possible to simulate much of vertical inheritance using templating and composite DataObjects. See CompositeVerticalInheritance for details. However, there's an inability to query across all tables sharing this custom superclass. There may also be issues with invalidating or refetching.

Horizontal Inheritance (table-per-concrete-class) is not currently supported. In this message,
Randy Leonard suggested that horizontal inheritance could be simulated by creating a subclass of CayenneDataObject which contained access to shared properties, and having data objects inherit from this class. Again there's an inability to query across all tables sharing this custom superclass.