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

EJB - QL finder methods

 
Sany Bel
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?
 
Dale Seng
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--
 
Nathaniel Stoddard
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic