• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

a) is the answer?

 
Win Yu
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • 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
 
Rufus BugleWeed
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
  • 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.
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A) is the answer.
 
Robin Zhang
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • 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 ]
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic