• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

ejbSelect...() method

 
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 ???
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • 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 ]
 
Drove my Chevy to the levee but the levee was dry. A wrung this tiny ad and it was still dry.
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic