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

EJB2 Query Language problems with subqueries

 
Csaba Birtalan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic