Thursday, September 9, 2010

ADF Model: Creating View Object (VO)

View Object (VO) is build on one or more entity objects. Please follow the below steps to create VO.

1. In Model project, right click on any package, select 'New View Object..'

2. Now, 'Create View Object' wizard appears -> In the 'Name' stop, Give Name for the VO, select/give correct package for the VO. The VO Name is generally follows the convention <objectname>VO. For e.g., EmpVO

3. Click 'Next' -> In the 'Entity Objects' section, select the EOs on which you want create the VO and shuffle to the right side.

4. Click 'Next' -> In the 'Attributes' section, select the EO attributes you want to include in the VO and shuffle them to the right side.

5. Click 'Next' -> In the 'Attribute Settings' section, you can give settings for each of the VO attributes.

6. Click 'Next' -> The 'Query' section displays the VO query along with the generated Where clause.

7. You can add 'Order By' clause to the query in 'Order By' filed. You can 'Edit..' and select the 'Order By' attribute'

8. Click 'Next' -> In the 'Bind Variables' section, you can add one or more bind variables. Bind variables are used to form parameterized queries.

9. Click 'Next' -> In 'Java' section, you can opt to select ViewObject class and VO row class etc.

10. Click 'Next' -> In the 'Application Module' section, you can check 'Application Module' check box and create application module to add this VO.

11. Click 'Next' to see the summary of the VO and then click 'Finish'.

12. Now, you'll find the newly created Association in model project under the specified package.

1 comment:

Related Posts with Thumbnails