Declarative way to populate child table’s data into Parent table’s column.



There are many ways to populate child table’s data into parent table’s column value. I have developed and posting a sample application for populating child table’s data in to parent table’s column value ( Foreign-key relation is one to many) with view assessors trick :P 

Download Application : Link 

Environment
Jdeveloper version: 11.1.1.5.0
Database: Oracle XE
Schema: HR

UI Screen looks like


Here I am populating all the employees under a department in to Department grid's row.  



  1. Create an ADF Web Application and model and view projects.
  2. Create business components like below structure.

3. Create an Application module like below structure.























4. Create Department view and add a transient attribute(Empname) 

DepartmentsView 











5. Create Employees view 











6.Create a view criteria( EmployeesViewCriteria ) in Employees view. See below picture. 





7.Create List of Values for EmpName attribute in Departments view. See below pics.






























8. Go to view accessors option in Departments view and click the pencil( Edit ) button.










9. Shuttle EmployeeViewCriteria and give value for viewcritera bind variable.Here DepartmentId is the attribute name from Departments view. 






















10. Create a JSF page (Main.jspx) and drop DepartmentsView collection from data controll as a table. 

11. Remove default component from EmpName column and add a new iterator component like below pic.