• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

ques from mock exam

 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which of the following methods must be implemented by an entity bean class with Container managed persistence?


Options

Select 1 correct option.

1. At least one ejbCreate(...)

2. ejbFindByPrimaryKey(...)


3. At least one ejbSelect(...)


4. At least one ejbFindByXXX(...) (other than ejbFindByPrimaryey(...))


5. None of these.

The correct answer mentioned in the mock exam was "5".

But isn't it option 2 (ejbFindByPrimaryKey(...) ) correct ???
 
Giju George
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
folks... got the answer.
In the spec it says,

An entity bean�s home interface defines one or more finder methods[16]

And ejbFindByPrimaryKey is NOT declared in the entity bean class. It's done by the container. I mistook home interface for entity bean class.

So, now I know that I should read the ques twice...
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, the ejbFindByPrimaryKey() method must be implemented by the container when it generates the concrete (container-specific) entity bean class. The bean provider must not declare such a method in his abstract entity bean class as mentioned in section 10.7.2 of the EJB 2.0 spec.


The entity bean class does not implement the finder methods. The implementations of the finder methods are provided by the container.

 
reply
    Bookmark Topic Watch Topic
  • New Topic