• 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

SQL IN operator in CMP

 
Bartender
Posts: 1205
22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my code I'm generating an array of ints that I would like to pass to a method in my EJB Home object to find the records that have any of those ints as their primary key. But I can't figure out how to use the SQL IN operator in the EJB QL in my weblogic-cmp-rdbms-jar.xml file.

For instance "(= first_name $0)" in the XML nicely translates to "WHERE first_name = '<first arg>'". What can I put in the XML to translate to "WHERE id in (921, 924, 925, 933)"?

I tried putting a <query> block in my ejb-jar, but apparently the version of the ejb-jar DTD I'm using doesn't support that.

I also looked into including a <finder-expression> in my weblogic-cmp-rdbms-jar.xml but couldn't figure out exactly what it wanted.

The specifics:
Weblogic 6.1
weblogic-cmp-rdbms-jar.xml uses http://www.bea.com/servers/wls510/dtd/weblogic-rdbms-persistence.dtd
ejb-jar uses http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd
weblogic-ejb-jar.xml uses http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd

Is it as easy as updating the DTD that ejb-jar uses? But isn't that dictated by the version of Weblogic I'm stuck with^H^H^H^H^H^H^H^H^H^H using?

Any assistance would be greatly appreciated.

Ryan
[ March 22, 2005: Message edited by: Ryan McGuire ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic