Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Mock Question HFEJB page 368. Q5.

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello fellow ranchers,

Legal declarations for ejbCreate methods. We are that the following is correct

public String ejbCreateAccount() throws javax.ejb.CreateException

but

public int ejbCreate() throws javax.ejb.CreateException

is wrong. I thought both were correct. We can use a primative as a key, can't we?

regards
Simon
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Although the spec is not clear on this, it appears as if a Serializable class is needed. So, this would be valid:

public Integer ejbCreate() throws javax.ejb.CreateException

And your DD entry would read:

<prim-key-class>Integer</prim-key-class>

If the bean provider implicitly declares in the entity bean class the type of the PK to be int, then one presumes that the container makes the necessary conversion between primitive type and wrapper type.
 
Simon Ingram
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Roger,

Yes, I guessed it may be something like that. Strange that the spec only says that it must be a legal value type in RMI-IIOP which includes primatives!
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic