Databases Reference
In-Depth Information
You can verify the creaion of the atributes in the
DeptEO.xml
file and compare the columns
in the
DEPT
table.
Have a go hero - set the primary key for the EmpEO.xml file
Now we have two enity objects in our
com.empdirectory.model.entity
package—one
is
EmpEO.xml
and the other is
DeptEO.xml
file. We have set the
Deptno
atribute as the
primary key for
DeptEO.xml
.
We have not created a separate
Rowid
atribute to represent a primary key for the enity
object. So, now it's your job to set the
Empno
as a primary key for the
EmpEO.xml
ile.
Bravo! You have set the
Empno
as the primary key. Now we have two atributes as the primary
key. Don't worry about that right now; we will take care of this later as we proceed.
Why association?
As the name suggests,
associaion
is used to associate enity objects. When you look closely
at the
EMP
table, you will find a
DEPTNO
column. In database terms, it is called a foreign key
because
DEPTNO
is the primary key for the
DEPT
table. The foreign key associaion for enity
objects is done using associaions.
The usage of associaion is exactly as that of a foreign key in a relaional database for
maintaining referenial integrity. When the database has a foreign key constraint, the
associaion is created automaically by ADF. The following screenshot explains the
relaionship between the
EMP
and
DEPT
table through
Deptno
:
Search WWH ::
Custom Search