Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

EJB2 Query Language problems with subqueries

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have a problem making a query work in EJB2. The following query in my ejb-jar.xml just won't work:



It throws with the following message:



If you have any idea how to fix this please let me know.

Or if you know where could I find documentation for this that would be helpful too. I searched the web but the examples I found were too simple
to figure this out.

Thanks in advance,
Csaba Birtalan.
 
Csaba Birtalan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay,

So for those who may encounter this problem:

You cannot execute a subquery like that in EJB2. You could do something like this:

SELECT OBJECT(o1) FROM TableName AS o1, TableName AS o2 WHERE o1.aField= ?1 and o1.aField = o2.aField and o1.createTime > o2.createTime

But this doesn't contain the (o2.createTime - 5 mins). This cannot be done either in EJB2.

So use direct JDBC or something else.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic