Valid 1Z0-898 Dumps shared by ExamDiscuss.com for Helping Passing 1Z0-898 Exam! ExamDiscuss.com now offer the newest 1Z0-898 exam dumps, the ExamDiscuss.com 1Z0-898 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com 1Z0-898 dumps with Test Engine here:
Given two entities with many-to-many bidirectional association between them: @ Entity public class Employee { Collection projects; // more code here } and @Entity public class Project { Set<Employee> emps; // more code here } What set of annotations correctly defines the association?
Correct Answer: C
Explanation/Reference: Every many to many relationship has obviously two sides: a Owning side and the Inverse side (which is... non-owning). Here the Employee class is the owning side. targetEntity: The entity class that is the target of the association. The dot (".") notation syntax must be used in the mappedBy element to indicate the relationship attribute within the embedded attribute. This mappedBy element is mandatory and must be placed on the Inverse side of the relationship in case we are mapping a Bidirectional. Here Projects class is on the inverse side. Note: @manyToMany defines a many-valued association with many-to-many multiplicity. Every many-to-many association has two sides, the owning side and the non-owning, or inverse, side. The join table is specified on the owning side. If the association is bidirectional, either side may be designated as the owning side. If the relationship is bidirectional, the non-owning side must use the mappedBy element of the ManyToMany annotation to specify the relationship field or property of the owning side. Reference: javax.persistence, Annotation Type ManyToMany JPA 2 Tutorial - Relationships - Many To Many