Oracle
1Z0-860 · Question #180
A developer wants to implement an association relationship between CarModel and CarManufacturer. Every car model is produced by a single manufacturer and every manufacturer produces many car models…
The correct answer is B. In CarModel class, declare an attribute of type CarManufacturer and annotate it with @ManyToOne. See the full explanation below for the reasoning.
Question
A developer wants to implement an association relationship between CarModel and CarManufacturer. Every car model is produced by a single manufacturer and every manufacturer produces many car models. While in this application it is essential to quickly determine the manufacturer of a model it is NOT necessary to determine which models a manufacturer produces. Given these requirements, which is an appropriate solution?
Options
- AIn CarModel class, declare an attribute of type CarManufacturer and annotate it with @OneToMany.
- BIn CarModel class, declare an attribute of type CarManufacturer and annotate it with @ManyToOne.
- CIn CarManufacturer class, declare an attribute of type CarModel and annotate it with @OneToMany.
- DIn CarManufacturer class, declare an attribute of type Collection<CarModel> and annotate it with
- EIn CarModel class, declare an attribute of type Collection<CarManufacturer> and annotate it with
How the community answered
(24 responses)- A13% (3)
- B71% (17)
- C8% (2)
- D4% (1)
- E4% (1)
Community Discussion
No community discussion yet for this question.