• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

entity bean question

 
Timber Lee
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In what manner is a reference to an Entity Bean obtained by a client?

A. Invoking the zero-argument public constructor of the bean.

B. Invoking the appropriate create() method of the home interface.

C. Invoking the newInstance() method of the home interface.

D. Invoking the newInstance() method
Which of the following MUST be declared for a CMP Entity Bean in its deployment descriptor?

A. Bean class.

B. Database connection factory reference.

C. Home and remote interfaces.

D. Primary key class.
E. Dataresource
[ February 26, 2003: Message edited by: Timber Lee ]
 
Shankar Ranganathan
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ans is B
 
Timber Lee
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what instance will create if creat() in home is executed?
Dataresource should be described in deployment descriptor for CMP Entity Bean ?
 
Eduard Manas
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Timber,
The answer to your first question is B, that is, by calling the create() method from the home interface. A is false because you cannot access the bean directly from the client.
The answer to your second questions I think its A and C only. Even though you can also specify references to connection resources and primary key, this is not necessary. Option D may seem a required parameter, but the EJB spec allows you to defer the definition of a CMP primary key until deployment time (section 10.8.3 of the EJB2.0 specs). This is not possible, though, for BMPs.
Eduard
 
Timber Lee
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank Eduard Manas for your explanation to me in detail
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic