• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Page 363 HFB

 
Ken Boyd
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question 5 from mock exam
public int ejbCreate() throws javax.ejb.CreateException

why above option is wrong?
Return type is int (i.e. valid) for Remote method return type..
 
Micheal Lau
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
However int is invalid to be a PK, recall there is a mandatory element for entity bean in DD -- <prim-key-class>.
As we say that is a "class", so the PK must be an "Object"
 
Micheal Lau
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More you can think is:
Recall there are 2 remove() from EJBHome, one takes handle and another takes PK as parameter.
If the PK can be int, double, .. etc, I think we may need 8 more remove()
so primitive type is not good to be a primary key
 
pradeep arum
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and if you want something close to a primitive type..wrap it up using the wrapper classes and use them as a primary key class ...ans convert it back using the toString() method.
hope this helps
thanks
Pradeep
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic