• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Legal Declarations of CMP ejbCreate()

 
Rahul Mishra
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • 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??
 
Balaji VR
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • 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)
 
satheesh krishnaswamy
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • 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..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic