• 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

EJB - QL finder methods

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can I use EJB-QL if I have a finder method that takes a list of ids as parameter. For eg., if I have to get the objects whose ids are in the list of ids passed to the finder method, how can I do it through EJB-QL?
[ April 29, 2004: Message edited by: Chris Mathews ]
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you looked at the EJB-QL portion of the EJB specification? You should probably do that.
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EJBQL only works on a static number of parameters so you can't really do what you want in a standard way without restorting to Java code. However, many vendor offer extensions to allow dynamic query creation in CMP for just these types of problems, check your Application Server's documentation.
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In case you got around to looking at the EJB-QL BNF, you should notice that it doesn't allow you to do something like "SELECT OBJECT(o) FROM Something AS o WHERE o.value IN ?1" where ?1 is defined as a Collection (or other container type).
A home method may be what you need to accomplish this.
reply
    Bookmark Topic Watch Topic
  • New Topic