PATH  Documentation > WebObjects 4.5 > EOF Tools and Techniques

Table of Contents Previous Section

Creating a Subclass

Enterprise Objects Framework supports mapping database tables to inheritance hierarchies of enterprise object classes using three different approaches. For one of the approaches-single table mapping-EOModeler provides support to help you model the mapping. In the single table mapping, all the enterprise object classes in the inheritance hierarchy map to the same database table; each class makes use, however, of different sets of the tables columns. Consequently, you need to create an entity for each enterprise object class in the hierarchy, and each of the entities map to the same table.EOModeler facilitates this by creating "subclass entities" and setting up the parent-child relationships for you.

To create a "subclass" entity, select the entity you want to use as the parent and choose Property Create Subclass. A new entity is created that maps to the same database table as the parent entity.

For more discussion of inheritance, see the chapter "Advanced Enterprise Object Modeling" in the book Enterprise Objects Framework Developer's Guide.

Table of Contents Next Section