Creating View Objects with Polymorphic View Rows: Defining the VO Hierarchy
To create view objects with polymorphic view rows, you first set up the VO hierarchy:
1. Identify a VO to be the base, and base it on the base entity object. In the example in the slide, the PersonListVO VO is the base, and is based on the PersonEO entity object.
2. Identify a discriminator attribute for the view row, and give it a default value. Select the Discriminator check box to mark the attribute as the one that distinguishes which view row interface to use. You must provide a value for the Default field that matches the attribute value for which you expect the base view object’s view row interface to be used. For example, in the PersonListVO VO, mark the PersonType attribute as the discriminator attribute and provide a default value of PERS.
3. If you have methods to extend, enable a custom view row class for the base VO, and expose at least one method on the client row interface. This can be one or all of the view row attribute accessor methods, as well as any custom view row methods. The example does not use such methods.
Create a new VO that extends the base VO. In the example, EmployeeListVO extends the base PersonListVO VO.
5. On the Entity Object page of the Create View Object wizard, select the entity object subtype appropriate for the VO subtype that you are going to create. In this example, select Employees and move it to the Selected list. Click Yes when asked if you want to override the existing entity usage.