This week's book giveaway is in the Open Source Projects forum.
We're giving away four copies of Spark in Action and have Jean-Georges Perrin on-line!
See this thread for details.
Win a copy of Spark in Action this week in the Open Source Projects 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Page 363 HFB

 
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..
 
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
 
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
 
Now I am super curious what sports would be like if we allowed drugs and tiny ads.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic