Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Primary key question

 
Gustavo Dutra
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear,

I am trying the final exam of the HF book,

The question 46 has the following affirmation:

" Setter methods for fields associated with a primary key MUST NOT be
exposed through a client view ",

the book says it is true,

but on the specification, page 130 we have the following paragraph:

"Once the primary key for an entity bean has been set, the Bean Provider must not attempt to change it by use of set accessor methods on the primary key cmp-fields. The Bean Provider SHOULD therefore not expose the set accessor methods for the primary key cmp-fields in the component interface of the entity bean. "

LOOK, the word is SHOULD instead of must.....

I know that a IllegalStateException must be thrown if the bean provider try to modify the key value, but I did not find anything about the restriction
used on the question.

Any idea???

Thanks,

Gustavo
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gustavo,

I wouldn't dwell on the difference between 'must not' and 'should not'. Obviously, exposing/using setters for the primary key fields is wrong.

Regards,
Dan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic