• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ejbSelect...() method

 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ???
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic