• 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
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
Bartenders:
  • Piet Souris
  • Mikalai Zaikin

Legal Declarations of CMP ejbCreate()

 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Legal Declarations of CMP Bean ejbCreate()

A)public void ejbCreateBigCustomer() throws CreateException;
B)public String ejbCreateAccount() throws createException;
C)public int ejbCeate() throws CreateException;

Ignoring the fact that none of them have arguements i picked the correct answer as 'B' and 'C' . But HFEJB picks only B as the answer?

Why??what's wrong with C??
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all, the return type of ejbCreate() method must be a public, Serializible class

Check out page. 333 --> "Rules for Primary Keys"

The option C is returning int, that is a data type (not a class)
 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


Legal Declarations of CMP Bean ejbCreate()

A)public void ejbCreateBigCustomer() throws CreateException;
B)public String ejbCreateAccount() throws createException;
C)public int ejbCeate() throws CreateException



The Answer should be only B.
As per the Specs the return type of ejbCreate() is Entity Bean's Primary Key Class or it should be a Object and cannnot be a primitive data type as what Mr.Balaji told.
Also assuming,createException is a typo.It should be CreateException.

B.T.W what server r u using??? I guess in JBoss or weblogic,it will not allows us to use like this-ejbCreateAccount().It should be ejbCreate().Any experts comments on this part,Please..
reply
    Bookmark Topic Watch Topic
  • New Topic