Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB Home And Select

 
Vishnu Munnangi
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

Please go through the following question from one of the mock exams.

Q) A typical use of ejbHome and ejbSelect method would be?
Select 2 Answers
A. use ejbSelect methods within ejbHome methods to return entities
B. use ejbSelect methods to access fields of a bean instance
C. use ejbHome methods to perform operation not specific to a entity instance
D. Use ejbHome methods to initialize entity bean instance variables

The Ans: given are B and C

I feel that A, C are correct.

Can any one please explain why option B is correct?
Thanks in Advance.
 
Keerthi P
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
B. use ejbSelect methods to access fields of a bean instance


Looking at the option, it is not clear if it is referring to cmp fields or static final fields. Anyway, ejbSelect method can still access cmp fields, when called from business methods that are defined in component interface.
 
Vishnu Munnangi
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks keerthi for the reply,

But I feel that option A is also correct
A. use ejbSelect methods within ejbHome methods to return entities
We can use ejbSelect methods within ejbHome methods right.

Correct me if I am wrong.

Thanks
 
Keerthi P
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. You are right.
 
Will St Hubert
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I have use ejbSelect<method> within an ejbHome<method> I think this is not clear.

see example :

public Collection ejbHomeListAllUserWithActiveCart()throws FinderException{
Collection list = null;
list = ejbSelectAllUserWithActiveCart();
return list;
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic