This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Entities association relationship defaults - Choose Correct statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Entities association relationship defaults - Choose Correct statement" Watch "Entities association relationship defaults - Choose Correct statement" New topic
Author

Entities association relationship defaults - Choose Correct statement

Amar Gadewar
Greenhorn

Joined: Nov 25, 2008
Posts: 3
The following is from a mock test on Whizlabs. Questions 32.

Choose 2 correct statements about the association relationship defaults that applies to persistence entities:

a. It is not necessary that the relationship mapping defaults that applies to entities using annotation modeling will be same as if defined using deployment descriptor.

b. A unidirectional relationship can have only owning side.

c. A unidirectional relationship can have only reference side.

d. mappedBy element is used to refer the owning side in case of bi directional relationships


The correct answers given are B and D.

I am clear about A been incorrect, that the defaults should be same for association relationship, regardless of using Annotations or Deployment Descriptor.
So A is incorrect.

I am also clear about B been the correct, as in Unidirectional Relationship, there is only one Owning side which has the reference to the other entity.

Here i am assuming the that the existing of foreign key has not relation with regards to Ownership.

C is incorrect as B is Correct.


D is incorrect it is the inverse side. Now as per me there is only one correct statement above. Please comment if otherwise.

Raf Szczypiorski
Ranch Hand

Joined: Aug 21, 2008
Posts: 383
I think D should say:
"mappedBy element is used to refer to the owning side in case of bi directional relationships"
or even
"mappedBy element is used by the inverse side to refer to the owning side in case of bi directional relationships"
Amar Gadewar
Greenhorn

Joined: Nov 25, 2008
Posts: 3
Thanks Raf, Makes sense now with the changed wording. Maybe just a typo while preparing the question.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Entities association relationship defaults - Choose Correct statement
 
Similar Threads
Sun Assessment Exam Question 2
Mock Question about @ManyToOne and @OneToOne
HttpSessionBindingListener does not need to be configured in the deployment descriptor.
is-a relationship confusion
Answers of Sun's Free Proficiency Assessment