• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

demo exam question

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Identify all correct requirements for a CMP entity bean class? [Check all correct answers]


1 The class must be defined as public.
2 The class must define a public constructor that takes no arguments.
3 The class must not be defined as abstract.
4 The class must define the finalize() method.
5 The class must implement, directly or indirectly, the javax.ejb.EntityBean interface.



The correct answers are 1 2 and 5 .

why should 2 be correct? . In the enterprise bean we dont declare a zero args public constructor explictly .


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

The public constructor with no arguments is used by the container to create a newInstance of the bean.

Thanks

-- Ravi
 
arunij katiliyar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The doubt is why is there an emphasis in option 2. I had never declared a zero args constructor for an ejb . I think option 2 should be rephrased.

The class "must" define a public constructor that takes no arguments
 
ravi janap
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This has what the specification to say

10.6.2 Enterprise Bean Class
The following are the requirements for an entity bean class:
The class must implement, directly or indirectly, the javax.ejb.EntityBean interface.
The class may implement, directly or indirectly, the javax.ejb.TimedObject interface.
The class must be defined as public and must be abstract. The class must be a top level class.
The class must define a public constructor that takes no arguments.The class must not define the finalize() method

Thanks

-- Ravi

[ March 25, 2005: Message edited by: Ravindra Janapareddy ]
[ March 25, 2005: Message edited by: Ravindra Janapareddy ]
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi , its not talkin about Bean Provider giving no arg constructor.So do expect op. 2 to be a valid answer.
Read it as class must HAVE.....
Amol.
 
You ought to ventilate your mind and let the cobwebs out of it. Use this cup to catch the tiny ads:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic