aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes primary key type can't be primitive type. True? 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 "primary key type can Watch "primary key type can New topic
Author

primary key type can't be primitive type. True?

warren li
Ranch Hand

Joined: May 23, 2006
Posts: 128
In HFEJB book, I saw "public int ejbCreate() throws CreateException" is considered as wrong. So, is it true that primary key type must be java object type, and cannot be primitive type?

Thanks for confirmation.


SCBCD 1.3: 94%<br />SCWCD 1.4: 91%<br />SCJP 5: 95%
warren li
Ranch Hand

Joined: May 23, 2006
Posts: 128
Found the answer to myself. Thanks.
NareshAnkuskani Kumar
Ranch Hand

Joined: Sep 15, 2005
Posts: 76
Hi wareen,

if the return type of the 'ejbCreate' method must be java object type. then how to deal with primary key whose datatype is number at the database end.

should we wrap primary key (the integer value) using java wrapper classes and return it from ejbCreate method.
warren li
Ranch Hand

Joined: May 23, 2006
Posts: 128
yes. use the wrapper classes.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: primary key type can't be primitive type. True?