• 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

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!
 
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic