I cannot get the MAX() function to work within a finder.

Environment: NT 4.0, jBoss 2.1-beta with tomcat

Here's my jaws.xml file:
<jaws>
 <enterprise-beans>
  <entity>
   <ejb-name>CustomerBean</ejb-name>
   <finder>
    <name>findNewest</name>
    <query>(key = (SELECT MAX(key) FROM CustomerBean))</query>
<!--
    <query>key = (SELECT COUNT(*) FROM CustomerBean)</query>
-->
    <order></order>
   </finder>
  </entity>
 </enterprise-beans>
</jaws>

Here's the result:
[JAWS] java.sql.SQLException: Column not found: KEY in statement [SELECT
key FROM CustomerBean WHERE (key = (SELECT MAX(key) FROM CustomerBean))]

If, however, I use  COUNT(*) instead (commented out above) I get a
sensible result. Its the MAX(key) that upsets jBoss.

Is this a JAWS bug?
If so, is there a work-around. I would prefer not to embed my SQL.

Thanks in advance...


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to