Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Primary key question

Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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???


Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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

Can you shoot lasers out of your eyes? Don't look at this tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic