aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes return type for ejbCreate method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "return type for ejbCreate method" Watch "return type for ejbCreate method" New topic
Author

return type for ejbCreate method

Chandrasekhar Vidhyadharani
Greenhorn

Joined: Mar 05, 2004
Posts: 11
Can anyone tell me what would be the return type for my own custom created ejbCreate(x,x,x) method? Do i need to write even ejbPostCreate method for the ejbCreate method i created?
Thanks in advance
Chandoo
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Originally posted by Chandrasekhar Vidhyadharani:
Can anyone tell me what would be the return type for my own custom created ejbCreate(x,x,x) method? Do i need to write even ejbPostCreate method for the ejbCreate method i created?
Thanks in advance
Chandoo

Hi,
because u're asking about ejbPostCreate I'll assume you're talking about entity beans only.
the return type for the method signature must be the PK class or type(depends on having a compound pk or not), inside the method you must return null.
About ejbPostCreate, yes, it's mandatory to have one ejbCreateXXXX ejbPostCreateXXX(returns void) for each createXXX method you have at the home interface, notice that the create method is not mandatory for entity beans only for session beans.
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
ejbCreate returns the primary key value (possibly null if it is CMP). And yes, you need to have a corresponding ejbPostCreate to go along with it. You can also put a method create(...) in your home interface that the client actually invokes -- whose signature indicates a regular value of the local component interface type.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Chandrasekhar Vidhyadharani
Greenhorn

Joined: Mar 05, 2004
Posts: 11
Thanks Marcos Maia ,Nathaniel Stodard for your replies. I figured it out now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: return type for ejbCreate method
 
Similar Threads
Mock Question
How to create Entity Bean without a Primary Key class
confusion on ejbCreate
Return type of ejbCreate
ejbCreate() throws CreateException