Oracle
1Z0-898 · Question #53
The department entity has a unidirectional One To Many relationship to the employee entity. The developer wants to model this relationship as a java.util.map such that the key of map is true…
Sign in or unlock 1Z0-898 to reveal the answer and full explanation for question #53. The question stem and answer options stay visible for context.
Entity Relationships
Question
The department entity has a unidirectional One To Many relationship to the employee entity. The developer wants to model this relationship as a java.util.map such that the key of map is true employee name. The primary key of the Employees entity is empId, an integer. Which of the following is correct?
Options
- A@OneToMany (targetEntity = Employee.class)
- B@OneToMany @mapKey (name, "name") map < integer, Employee> Employees;
- C@OneToMany @MapKeyJoinColumn (name = "name") map <String, Employee>
- D@OneToMany @mapsId (name = "name") map <String, Employee> employees;
Unlock 1Z0-898 to see the answer
You've previewed enough free 1Z0-898 questions. Unlock 1Z0-898 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.
Topics
#OneToMany#@MapKey#Map relationship#collection mapping