== Polymorphic Entities ==

A ''polymorphic entity'' usage is one that references a base entity object in an inheritance hierarchy and is configured to handle subtypes of that entity as well. The figure shows the results of using a view object with a polymorphic entity usage. The entity-based UserList view object has the User entity object as its primary entity usage. The view object partitions each row retrieved from the database into an entity row part of the appropriate entity object subtype of User. It creates the appropriate entity row subtype based on consulting the value of the discriminator attribute. For example, if the UserList query retrieves one row for user ngreenbe, one row for manager sking, and one row for technician ahunold, the underlying entity row parts would be as shown in the figure. 

 {{attachment:eopolymorph.gif}}

''Inheritance is a powerful'' feature of object-oriented development that can simplify development and maintenance when used appropriately. As you've seen in Section "Creating Extended Components Using Inheritance", ADF Business Components supports using inheritance to create new components that extend existing ones in order to add additional properties or behavior or modify the behavior of the parent component. This section helps you understand when inheritance can be useful in modeling the different kinds of entities in your reusable business domain layer.

 {{attachment:voinherit.gif}}

 See Also:: 
 * [[http://download.oracle.com/docs/html/B25947_01/bcadvvo006.htm|Using View Objects to Work with Multiple Row Types]], Oracle® Application Development Framework Developer's Guide For Forms/4GL Developers
