aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes HFEJB Page 368, Q # 5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "HFEJB Page 368, Q # 5" Watch "HFEJB Page 368, Q # 5" New topic
Author

HFEJB Page 368, Q # 5

Alfred Harre
Ranch Hand

Joined: Apr 29, 2004
Posts: 73
Which are legal declartions for bean's ejbCreate() method?

B. public String ejbCreateAccount() throws javax.ejb.CreateException
D. public int ejbCreate()throws javax.ejb.CreateException

Why can not option D be the correct answer? Any ideas? thoughts?
Mike Melton
Greenhorn

Joined: Jun 29, 2004
Posts: 13
Is this a question about entity or session beans? Either way, option D does not represent a valid signature. For session beans, ejbCreate() should have void return type. For entity beans, ejbCreate() returns the primary key type, which cannot be a primitive type like int. (Note that getPrimaryKey() returns a java.lang.Object!)

HTH
Mike
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HFEJB Page 368, Q # 5