0 Replies Latest reply on Apr 4, 2003 5:35 PM by bbender

    declared-sql, hypersonic, "limit" keyword

    bbender

      Hi folks,

      I'm trying to do a smarter finder using Xdoclet's @jboss.declared-sql tag. What I've got for the bean is:
      -snip-
      * @jboss:declared-sql signature="java.util.Collection findWindowByVisibility(int start, int windowSize, java.lang.String sortBy, boolean visible)"
      * other="LIMIT {0} {1}"
      * where="visible={3}"
      * order="{2}"
      -snip-

      the jbosscmp-jdbc.xml snippet that gets generated for this is:
      -snip-
      <declared-sql>
      <![CDATA[visible={3}]]>
      <![CDATA[{2}]]>
      <![CDATA[LIMIT {0} {1}]]>
      </declared-sql>
      -snip-

      and the query that gets generated (I can see this in the exception ) is:
      -snip-
      SELECT serialNumber FROM TERMINAL WHERE visible=TRUE ORDER BY 'name' LIMIT 0 30
      -snip-

      Unfortunately, to be valid for the Hypersonic database that I'm currently using, the "LIMIT 0 30" has to be at the beginning, after the SELECT, not at the end (http://hsqldb.sourceforge.net/doc/hsqlSyntax.html#SELECT). Any quick _standard_ way to make JBoss do this? Or do I need to use a different data source or modify the JBoss source (yeah yeah, I know, "send a diff" -- I definitely would if I got it working this route).

      Thanks for any pointers,

      - Brian