Answer(s)
- developer wants to implement a relationship between Company and Department entity classes.Every department belongs to one company, and one company has several departments. In thisapplication it is essential to quickly determine which company a department belongs to and toalso easily access all departments of a given company. Which two declarations provide a solutionto these requirements? (Choose two.)A. In class Department:@ManyToOneprivate Company company;
- In class Department:@OneToManyprivate Company company;
- In class Department:@OneToMany(mappedBy="department")private Collection companies;
- In class Company:@ManyToOne(mappedBy="company")private Collection departments;
- In class Company:@OneToMany(mappedBy="company")private Collection departments;
Correct Answer developer wants to implement a relationship between Company and Department entity classes.Every department belongs to one company, and one company has several departments. In thisapplication it is essential to quickly determine which company a department belongs to and toalso easily access all departments of a given company. Which two declarations provide a solutionto these requirements? (Choose two.)A. In class Department:@ManyToOneprivate Company company;
In class Company:@OneToMany(mappedBy="company")private Collection departments;