aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Return type of ejbCreate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Return type of ejbCreate" Watch "Return type of ejbCreate" New topic
Author

Return type of ejbCreate

Vipin Mohan
Ranch Hand

Joined: Nov 15, 2003
Posts: 79
hi all
According to the section 10.6.4 of the EJB 2.0 Specs, the return type of ejbCreate method of a CMP enity bean is the primary key type of the bean. The primary key field cannot be a primitive type, so that means that ejbCreate cannnot return a primitive type.
However, I have seen examples in which ejbCreate returns the int return type. Also void in some cases.
Can someone please comment on this ?
Thanks
Vipin
Mikalai Zaikin
Ranch Hand

Joined: Jun 04, 2002
Posts: 3211
    
    6
Hello,
I can hardly believe that ejbCreate can return primitive, because it must return anything which is child of java.lang.Object.
NOTE, CMP beans should actually return "null" in ejbCreate, and BMP "real" PK.
about "void" return type for ejbCreate - this is signature for session beans, not entity beans.


Free SCDJWS 5.0 Study Guide - SCDJWS 5.0 Quiz (How to get SCDJWS 5.0 Quiz)
Java Platform, Enterprise Edition 6 Web Services Developer Certified Expert Exam Study Guide and Quiz
Vipin Mohan
Ranch Hand

Joined: Nov 15, 2003
Posts: 79
hi
Thanks for your reply. I wanted to be sure, because I have seen some wrong examples with int as return type of ejbCreate.
Just saw your SCBCD study guide. Really good work you have got here.
Congrats !
Vipin
Mikalai Zaikin
Ranch Hand

Joined: Jun 04, 2002
Posts: 3211
    
    6
Thanks, Vipin
It's not finished yet. Work in progress.
Hopefully in 1..2 weeks it will be done.
Thomas De Vos
stable boy
Ranch Hand

Joined: Apr 12, 2003
Posts: 425
The return type cannnot be void, final or static for CMP Entity beans.
And the return type must be the primary key class (String, Object, compound)
However the actual return value is null.


Try your free <a href="http://www.javacertificate.com" target="_blank" rel="nofollow">SCJP 1.4</a> certification centre.<br />Try your free <a href="http://www.j2eecertificate.com" target="_blank" rel="nofollow">SCWCD</a> certification centre.<br />Try your free <a href="http://www.ejbcertificate.com" target="_blank" rel="nofollow">SCBCD</a> certification centre.<br />Try your <a href="http://www.webspherecertificate.com" target="_blank" rel="nofollow">Websphere (Test 285) </a> certification centre.<br />Try your <a href="http://www.j2mecertificate.com" target="_blank" rel="nofollow">SCMAD</a> certification centre. (New)<br /> <br /><a href="http://blogs.javacertificate.com" target="_blank" rel="nofollow">Java/J2EE Certification Blogging</a>
 
 
subject: Return type of ejbCreate