• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Primary key question

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic