File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes a) is the answer? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "a) is the answer?" Watch "a) is the answer?" New topic

a) is the answer?

Win Yu
Ranch Hand

Joined: Oct 17, 2001
Posts: 224
for a CMP entity bean,what should the ejb method return?
c)Home interface

Rufus BugleWeed
Ranch Hand

Joined: Feb 22, 2002
Posts: 1551
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

Joined: Feb 27, 2002
Posts: 8927

A) is the answer.

Robin Zhang
Ranch Hand

Joined: Apr 11, 2002
Posts: 139
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

Joined: Jul 18, 2001
Posts: 2712
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 ]
I agree. Here's the link:
subject: a) is the answer?
It's not a secret anymore!