Tuesday, May 15, 2012

How to add attribute from related entity in view object

Take as scenario where we need to retrieve the related objects attributes in the same result set. In this article, I'm trying to explain how can we add attribute from related entity in view object. 

In BC4J, this scenario can be implemented using Entity Objects facility provided in View Object layer. These entity objects are used by the view object for accessing the related objects attributes and will be exposed in data control layer automatically.

Implementation Steps

Create Fusion Web Application, click on ADF Business Components and create business components from table based on Departments, Employees.

Open the EmployeesView.xml view object and select the Entity Objects tab. Move the Departments entity from available pool to selected pool as shown below.

Go to the Attributes tab, click on add attribute from entity. In Attributes window under Departments entity section move DepartmentName from available pool to selected pool as shown below.

Run the ADF Module Tester(application module) and select EmployeesView1 in AppModule. Now we can notice DepartmentName attribute is also displayed for the employee result set.

1 comment:

  1. Hi Deepak,

    This is pretty urgent. I have a VO and it has around 4 Underlying EO's. And one of the EO has close to 700 attributes. Very recently a set of 100 New attributes has been added to this EO.

    Now, is there any way I can add only those Unique newly added attributes from the EO to the VO.

    Deleting all the attributes from VO and readding them from the EO is not a feasible solution as there are lot of individual attribute level setting that I have done for the VO attribute.

    I hope you can understand the pain in re adding the 700 attributes from EO again.

    Thanks in Advance.

    Please help. THis is critical.