It is about declared-sql queries. This covered in for-pay docs.
In jbosscmp-jdbc.xml in query element you can specify declared-sql like:
         <query>
            <query-method>
               <method-name>ejbSelect<method-name></method-name>
               <method-params>
                  <method-param>java.lang.String</method-param>
               </method-params>
            </query-method>
            <declared-sql>
               <select>
                  <distinct/>
                  <ejb-name>MyBean</ejb-name>
                  <field-name>myField</field-name>
                  <alias>X</alias>
               </select>
               <from><![CDATA[ , table1 t1 ]]></from>
               <where><![CDATA[
                  LCASE(t1.name) = {0} AND t1.fk = X.id
               ]]></where>
               <order><![CDATA[ X.orderField ]]></order>
                <other>LIMIT 100</other>
            </declared-sql>
         </query>


[EMAIL PROTECTED] wrote:


I am using jboss-3.2.2RC1_tomcat-4.1.24 backed by a MySql database.
In the MySql SQL I can limmit the number of rows retrieved by a SELECT steatment by a LIMIT clause
How can I limit the number of objects in a collection (of a findAll for example) when possebly huge amounts of objects would match the selection.
And / or how can I find out in advance how much records would match the selection
In the jbosscmp-jdbc_3_0.dtd I found a section which declarese the syntaxt of an <other> element in the jbosscmp-jdbc XML deployment file but as I am anything else as an expert DTD reader
It does not tell me how and when that can (if at all) be used. The example mentions the LIMIT steatment.
Here is the piece extracted from the jbosscmp-jdbc_3_0.dtd
<!--
Declares the other sql that is appended to the end of a query.
Example: <other>LIMIT 100 OFFSET 200</other>
-->
<!ELEMENT other (#PCDATA)>
Could anyone give me a hint on how I could solve this problem.
Thanks a lot.




-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to