dcsimg
About return value of EJB2.0 CMP entity bean.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   leo_liu
Posted On:   Wednesday, April 17, 2002 07:23 PM

Dear All: I have a requestion about the return value of CMP bean of EJB2.0. In my mind the cmp's ejbCreate() method always return null , and Container will handle the createException.But when I see the example from j2sdkee1.3.1 (download from sun), the ejbCreate() return primariyKey? I don't know why, is there anybody can tell me the reason? the example code like following: public String ejbCreate ( String cid, String id, String street, String city, String zip, String state) throws CreateException { //Log.trace("AddressBean.ejbCreate..."); return create (id, street, city, zip, state); } private   More>>

Dear All:

I have a requestion about the return value of CMP bean of EJB2.0. In my mind the cmp's ejbCreate() method always return null , and Container will handle the createException.But when I see the example from j2sdkee1.3.1
(download from sun), the ejbCreate() return primariyKey?
I don't know why, is there anybody can tell me the reason?

the example code like following:

			
public String ejbCreate (
String cid,
String id,
String street,
String city,
String zip,
String state)
throws CreateException {
//Log.trace("AddressBean.ejbCreate...");
return create (id, street, city, zip, state);
}

private String create(
String id,
String street,
String city,
String zip,
String state)
throws CreateException {

setAddressID(id);
setStreet(street);
setCity(city);
setZip(zip);
setState(state);

return id;
}
   <<Less

Re: About return value of EJB2.0 CMP entity bean.

Posted By:   Bozidar_Dangubic  
Posted On:   Thursday, April 18, 2002 07:23 AM

in the case of CMP, in really the return from ejbCreate() is ignored. I am guessing sun designed the application in question to work for both CMP and BMP and had the key be returned from ejbCreate(). one way or the other, when CMP, return from ejbCreate() is ignored by the container.
About | Sitemap | Contact