Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

EJB - QL finder methods

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is it possible to have a finder method that takes a String array as a parameter?
 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That might be handy.
String[] attribList = {"one", "two", "three"};
findThingsInTheList(aList);
SELECT Object(d) from DATA d WHERE d.attrib IN (?1)
But I think today's spec says it's got to be a String, so it wouldn't work.
--Dale--
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dale,
Nice though -- but EJB-QL doesn't let you do that sort of thing yet. You can pass a regular String as a parameter and use it. Or, if you had a definite number of parameters, you could always do: ... IN (?1, ?2, ?3) ... etc.
 
    Bookmark Topic Watch Topic
  • New Topic