Databases Reference
In-Depth Information
Time for action - creating an association between EmpEO and
DeptEO objects
Carry out the following steps to create an associaion between
EmpEO
and
DeptEO
objects:
1.
Select the
New
opion from the
File
menu and select
ADF Business Component
from the Business Tier.
2.
Enter the package name as
com.empdirectory.model.association
and the
name as
EmpEOToDeptEOAssoc
in the
Create Associaion
wizard. The package
structure for all these business objects can be predefined from the
Tools |
Preferences | ADF Business Components | Packages
secion.
3.
Click on the
Next >
buton to create an associaion between the enity objects.
Select the value of
Cardinality
as
* to 1
from the drop-down menu to represent
the many-to-one relaionship between
EmpEO
and
DeptEO
.
The reason for setting the relations as many-to-one is to
represent that many Employee entities are available in a
single Department entity. Department is a single entity
that represents the collection of employees in it.
4.
Locate the
Deptno
atribute from
EmpEO
listed in the
Source Atribute
secion
and map it to the
Deptno
atribute of
DeptEO
in the
Desinaion Atribute
list.
5.
Ater the selecion, click on the
Add
buton to add the associaion entry for the
atributes.
6.
Click on the
Next >
buton to select properies for the associaion. Right now,
you can accept the default seings in the
Opions for the Business Components
secion in this chapter.
7.
Click on the
Finish
buton in the
Summary
secion to complete the creaion of
the associaion.
What just happened?
We have now created an associaion between the
EmpEO
and
DeptEO
.
xml
files. The
accessor
atribute for
DeptEO
is created in
EmpEO
, and for
EmpEO
one accessor is created in
DeptEO
.
This can be configured in the
Accessor
secion of the associaion object. The associaion
relaionship is referenced in the following diagram:
Search WWH ::
Custom Search