There are 5 major steps to achieve the result:
1. Execute SQL scripts to create/alter necessary DB objects (nested table type creation, employees table altering, data migration):
2. In the ADF application create necessary objects for departments and employees.
Two things to change in generated entity:
a) Change (if its different) type of attribute EmployeesIds to oracle.jbo.domain.Array
b) Switch view of entity to source mode and add attribute ElemType="java.lang.String" to EmployeesIds definition element.
After both preceding changes attribute definition XML element should look like this:
Note: probably depending on JDeveloper version in graphical view of attributes You may see wrong type for EmployeesIds. It can be shows as "Array", but don't worry about it if in XML source there is oracle.jbo.domain.Array:
3. Generate view row implementation class DepartmentsViewRowImpl.java for DepartmentsView object. Add there couple new methods. Here is the main trick of this example. Looks like selectManyShuttle component knows how to handle String, but not oracle.jbo.domain.Array. Thats why we need extra methods for conversion:
And please expose those methods to client.
4. One more specific to this example trick has to be done (that means it may be not necessary in Your particular case). While we're using nested table of varchar2 and employee ids in DB table employees are stored as Number, we need a little conversion in EmployeesView object. Will convert Number to String. To carry out this we need generate EmployeesViewRowImpl.java and change getEmployeeId method like this:
Select items are rendered directly from EmployeesView1 binding.
Here is what we should finally see in browser:
Thats it! Should work. Please download sample application to run it or check details of this example.
JDeveloper version 18.104.22.168