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

ejbSelect...() method

 
Giju George
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If an ejbSelect...() method returns a collection/set of local/remote interfaces or a cmp field value, where do we specify that ???
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Section 10.5.7 and following:

Typically an ejbSelect<METHOD>(...) method that returns entity objects returns these as EJBLocalObjects. If the ejbSelect<METHOD>(...) method returns an EJBObject or collection of EJBObjects, the Bean Provider must specify the value of the result-type-mapping element in the query deployment descriptor element for the select method as Remote.

[ August 05, 2004: Message edited by: Valentin Crettaz ]
 
Giju George
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's fine. But do we specify somewhere that it's returning a COLLECTION or SET ??

And what if it's returning a "cmp field"... where do we specify that??

This is what I got from the spec 10.7.4

The Container must use the contents of the query element, the corresponding EJB QL string and the type of the values selected as specified by the SELECT clause to determine the type of the values returned by a select method. The Container must ensure that there are no duplicates returned by a select method if the return type is java.util.Set.


But it still not clear
Read somewhere else in the spec that if we specify a "DISTINCT" in the select clause, then the container will return a SET (no duplicates ) !!!
[ August 05, 2004: Message edited by: Giju George ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic