• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt on enthuware answer (II)

 
Ralph Jaus
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mark Garland
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Ralph Jaus
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3817
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right. The question should specify primary key class instead of just primary key. It is has been fixed.

thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic