• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Page 363 HFB

 
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic