Which two declarations provide a solution to these requirements?

A 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 this
application it is essential to quickly determine which company a department belongs to and to also
easily access all departments of a given company. Which two declarations provide a solution to
these requirements? (Choose two.)

A 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 this
application it is essential to quickly determine which company a department belongs to and to also
easily access all departments of a given company. Which two declarations provide a solution to
these requirements? (Choose two.)

A.
In class Department:
@ManyToOne
private Company company;

B.
In class Department:
@OneToMany
private Company company;

C.
In class Department:
@OneToMany(mappedBy=”department”)
private Collection<Company> companies;

D.
In class Company:
@ManyToOne(mappedBy=”company”)
private Collection<Department> departments;

E.
In class Company;
@OneToMany(mappedBy=”company”)
private Collection<Department> departments;



Leave a Reply 0

Your email address will not be published. Required fields are marked *