Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

a) is the answer?

 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
for a CMP entity bean,what should the ejb method return?
a)NULL
b)Remote
c)Home interface
d)PrimaryKey
e)Enumeration
 
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the case of EJB 1.0, the ejbCreate() method returns void for CMP ; this method returns the bean's primary key in BMP. In EJB 1.1 the ejbCreate() method always returns the primary key type; with CMP, this method returns the null value. EJB's by Monson-Haefel, 2nd ED. O'Reilly, page 89.
This is annoying one home brewed tests. When I see it on tests for employment decisions, I want to SCREAM.
 
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A) is the answer.
 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a lot of mock exams I found from web are not really good, do not rely on them
[ April 12, 2002: Message edited by: Robin Zhang ]
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This question is poorly-worded because it doesn't specify if it is asking what type the method declares to return or what the method actually returns.
For CMP beans in 1.1 the ejbCreate method declares that it returns the Primary Key Class but the bean developer should explicitly return null in the method's implementation. Regardless the return value of a CMP bean's ejbCreate method is ignored by the Container.
Since this question is ambiguous I would have to choose the most appropriate answer. This would be d) PrimaryKey. I choose this because a) NULL does not exist in Java. There is a null but not a NULL.
Again let me restate that this is a poorly worded question and I whole-heartedly agree with Robin, most of the mock exams found on the Net are bogus. In fact, I haven't found a single one that is representative of what is actually tested on the exam. I haven't looked at Ian's mocks yet though.
[ April 12, 2002: Message edited by: Chris Mathews ]
 
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