nerdexam
Oracle

1Z0-860 · Question #256

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…

The correct answer is D. Ma pthe table PROJECT to an entity Project with a field or property cost mapped to the column COST. See the full explanation below for the reasoning.

Question

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?

Options

  • ASuch sets of tables cannot be mapped and keep the application portable.
  • BMap the table PROJECT as a secondary table for either the Employee or Department entity.
  • CMap the table PROJECT to bidirectional many-to-many relationships between the Employee and
  • DMa pthe table PROJECT to an entity Project with a field or property cost mapped to the column COST

How the community answered

(33 responses)
  • A
    3% (1)
  • B
    6% (2)
  • C
    12% (4)
  • D
    79% (26)

Community Discussion

No community discussion yet for this question.

Full 1Z0-860 Practice