*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Doubt on enthuware answer (II) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Doubt on enthuware answer (II) " Watch "Doubt on enthuware answer (II) " New topic
Author

Doubt on enthuware answer (II)

Ralph Jaus
Ranch Hand

Joined: Apr 27, 2008
Posts: 342
The following question is from enthuware:
Identify the correct statements about the primary key of an entity:

a) It cannot consist of multiple fields.
b) It must be serializable and must also override equals and hashCode methods appropriately.
c) In an entity class hierarchy, the class for which the primary key has been defined must be the
root class of the hierarchy and must be an Entity class.
d) If property-based access is used, the properties of the primary key class must be public or protected.
e) The primary key class must be public or default accessed and must have a public no-arg constructor.

The correct answers are a) and d).

The explanation for b) being correct is: "The primary key class ..."

In my opinion b) isn't correct because the question asks for a "primary key" and not for a
primary key class or a composite primary key. So

@Id int id;

is a valid primary key and since id is of primitive type it hasn't even an equals or hashCode
method that could be overriden.

SCJP 5 (98%) - SCBCD 5 (98%)
Mark Garland
Ranch Hand

Joined: Nov 11, 2006
Posts: 226
Hi Ralph,

Sorry if this sounds a little silly, but I am not sure I understand your question.

1) correct answers are a and d
2) you then say that b is also correct (but it wasn't in 1).
3) you then argue that b isn't correct (but it wasn't in 1).

Sorry!

MG


28/06/06 - SCJP - 69%, 05/06/07 - SCWCD - 92%, 28/02/08 - IBM DB2 v9 Fundamentals (Exam 730) - 87%, 18/11/08 - IBM DB2 v9 DBA (Exam 731) - 89%, 26/02/11 - SCBCD - 88%
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
oh that was typo from Ralph.

I agree with Ralph...answer--

but all in given option's you have to select the answer which is the nearest.

if you don't this way, then definitely we are challenging the question...


SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
Ralph Jaus
Ranch Hand

Joined: Apr 27, 2008
Posts: 342
Hi,

sorry for causing confusion. I meant "The correct answers given by enthuware are b) and d)".

Amandeep is right: There are indeed many such questions/answers in enthuware that are
not quite correct or at least discussable. It's best to choose the most likely answer and
hope for questions with unique answers in the real exam.
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 3255
    
    2
You are right. The question should specify primary key class instead of just primary key. It is has been fixed.

thanks!


Enthuware - Best Mock Exams and Questions for Oracle/Sun Java Certifications
Quality Guaranteed - Pass or Full Refund!
 
Consider Paul's rocket mass heater.
 
subject: Doubt on enthuware answer (II)
 
Similar Threads
needs clerification from chapter 6 Entity Bean Synchronization
an question from mock exam
question about primary key in JPA
JavaBeat Question
Answers to Mock Questions