After having created and tested the BC4J objects in this link, now we can create entity associations. Entity associations allow you to create joins between tables in the Java layer. In other words, entity associations create a relationship between two entity objects.In this article, you will see how to create a master detail relationship between the Department Entity Object and the Employee Entity Object in the Fusion Apps tech stack. One single instance of the Entity Object java class will be created for each record in the underlying table.
Right click on the package to create a new Enity Object, of course this will be created on the table.
Right click on schema/server to create a new entity object for DeartmentEO
Browse the table name to select Department table.
Select all the columns of the table to be a part of Entity Object, this is a usual practice when creating entity object.
Entity object should have a primary key, this should be the Department Id column in this case.
You can optionally create the default view object, or you can create the view object later. In this case, we will create view object later. Just create the entity object for now, and therefore simply click on Next.
Now your DepartmentEO has been created.
Repeat the steps for Location, by creating LocationEO based on Location table.
Now, we can create Entity Association.
Right click server within schema because we need to create association in xxa2f.oracle.apps.hr.schema.srver.
projects--> New Association
Now we need to create a linkage between Employee and Department EO
Give your association a user friendly name
Select 1 to many, because one Department will have potentially many Employees.
Select DeptId from EmployeeEO and DepartmentEO and click Add.
Use defaults in Step 3 of 5, and click next.
Click Finish.
Your Entity Association has been created.