Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
warren li
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
warren li
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found the answer to myself. Thanks.
 
NareshAnkuskani Kumar
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes. use the wrapper classes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic