Meaningless Drivel is fun!
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
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Doubt on enthuware answer (II) " Watch "Doubt on enthuware answer (II) " New topic

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).



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: 850
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-
Ralph Jaus
Ranch Hand

Joined: Apr 27, 2008
Posts: 342

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: 3556
You are right. The question should specify primary key class instead of just primary key. It is has been fixed.


Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!
I agree. Here's the link:
subject: Doubt on enthuware answer (II)
It's not a secret anymore!