A developer is designing a Java Persistence application that is mapped to a set of existing tables.
This set includes table EMPLOYEE, DEPARTMENT, and PROJECT. Tables EMPLOYEE and
DEPARTMENT do NOT define any foreign key constraints to table PROJECT. Table PROJECT
defines foreign key constraints with references to tables EMPLOYEE and DEPARTMENT and an
extra column called COST. The table EMPLOYEE is mapped to an entity Employee and the table
DEPARTMENT to an entity Department.
How can the table PROJECT be mapped so the persistence application can be portable?
A.
Such sets of tables cannotbemappedandkeep the application portable.
B.
Map thetablePROJECT asasecondary table for either the Employee or Departmententity.
C.
Map the table PROJECT to bidirectional many-to-many relationships between the
Employeeand Departmentusing a Java. util.Mapas the type ofthefield or property.
D.
Mapthe tablePROJECT to an entity Projectwith afield or property cost mappedto thecolumn
COST and one-to-many relationshipstothis entity in the Employee and the Department.