I am trying to use EJBQL on JBoss3.0 alpha. As far as I can tell from the behavior I can see in my application and from the logs, the WHERE clause of my EJBQL is being ignored. I have tried modifying the WHERE clause in several ways, and cannot seem to get it to be converted into SQL. Is this a bug or am I doing something wrong?
<![CDATA[SELECT OBJECT(obj) FROM CustomObjectEJB AS obj WHERE name like '%Modified%']]>
[2001-12-06 18:35:14,822,CMP,DEBUG] EQL-QL:
SELECT OBJECT(obj) FROM CustomObjectEJB AS obj WHERE name like '%Modified%'
[2001-12-06 18:35:14,947,CMP,DEBUG] Assembly: SELECT/OBJECT/(/obj/)/FROM/CustomObjectEJB/AS/obj^WHERE/name/like/'%Modified%'
[2001-12-06 18:35:14,947,CMP,DEBUG] findLessThanId SQL: SELECT t1_obj.TwId FROM TwCustomObject t1_obj
Notice that the generated SQL here has no WHERE clause. There seems to be a '^' character before the WHERE which might indicate a problem?
Sorry to reply to my own post, but I realized my mistake overnight: I had not properly qualified the field name in the WHERE clause. When I use 'obj.name' instead of 'name' in the WHERE, it works as expected.
It would be cool to get some kind of error here, but hey, it's only alpha.