The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes quick question on ejbCreate Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » EJB Certification (SCBCD/OCPJBCD)
Reply Bookmark "quick question on ejbCreate" Watch "quick question on ejbCreate" New topic
Author

quick question on ejbCreate

Bob Walker Jr
Ranch Hand

Joined: Jun 02, 2003
Posts: 46
I have seen it mentioned in many places that signature of ejbCreate for a CMP entity bean should be the primary key type (confirmed in the specs also) but the actual return value in the method code should be null. I checked the specs (section 10.6.4) but it does not say anywhere that the return value should be null. How come
Where the hell are we getting this rule from?
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
Howdy
It *is* in the spec, but the spec makes it *really* hard to find these things. On page 171, section 10.5.2 "Bean Provider's entity bean instance's view"
It says:
" The implementation of the Bean Provider's ejbCreate<method> methods should be coded to return a null."
cheers,
Kathy


Co-Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0596007124/ref=jranch-20" target="_blank" rel="nofollow">"Head First Design Patterns"</a><br /> <br />Just a Jini girl living in a J2EE world.
Bob Walker Jr
Ranch Hand

Joined: Jun 02, 2003
Posts: 46
Thanks a lot, Kathy. I was going nuts over this. I thought that everything about ejbCreate() would be there in 10.6.4 which is: "Responsibilities of Enterprise Bean Provide" : "ejbCreate<method> method". So basically to learn every thing about something, I need to read every line of the spec and then organize the content myself.
Kathy, I serious hope your book takes care of this
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
I think that's the most challenging thing about the spec... some really important 'rules' show up in only one place, rather than redundantly everywhere they *should* be. So you can read a section that should have everything all summarized, but it will leave something out that appears only somewhere *else* Arrghh!
Cheers,
Kathy
 
 
subject: quick question on ejbCreate
 
Threads others viewed
Return type of ejbCreate
ejbCreate() in Entity bean returns null
'ejbCreate' methods should be coded to return a null value. is it true?
ejbCreate return type..
ejbCreate's return value(Entity Bean)
MyEclipse, The Clear Choice