Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Wednesday, August 19, 2009

Multiple EO based VOs in ADF 11g

It is very common to have a data model where you have a table jobs with fields jobid, jobname and another table say emp table with empId, empName , jobId where jobid is a ref to job table.

On the UI you usually need to show empName, and the job he is associated rather the job id.
So, to fulfill such requirement you can model you BC4J as following:

Create EmpEO entity over emp table and create JobEO enitity over Jov table. Now, you can create a single VO say EmpJobVO which is based on EmpEO and JobEO. You can shuttle all the attributes from EmpEO and only jobName from the JobEO while creating the VO.

One thing to take care is in the query step is to make sure that the join condition is specified in the where clause. If this will not be specified it will perform a Cartesian join.

No comments: